Fundamentals One Boot Camp
Competencies, Behaviours and Knowledge units
- TC1 Logic: writes good quality code (logic) with sound syntax in at least one language
- TC4 Test: can test code and analyse results to correct errors found using either V-model manual testing and/or using unit testing
- TC10 Can apply good practice approaches according to the relevant paradigm (for example object oriented, event driven or procedural)
Resources Required
- Slides
- Laptops
- Internet access
- Post-its
- Markers
- A3 paper for apprentices to draw on
- Whiteboard (or flipcharts if this is not possible)
Mentors / Languages
Two–three mentors required in addition to leads. These should be able to cover support for the required languages.
Several exercises (katas and code starters) will need to be ported to required languages.
Prep-work for apprentices
None
Follow-on tasks
Organisation mentors should look to exercise the knowledge we’ve covered in the boot camp. Below are suggestions for tasks that would do this, but please use your own judgement to work out what to do. There is no need for anything to be returned to MD or the presenters—it’s just a learning exercise.
- Draw a diagram showing how the classes interact in some code you have been working on
- We’d like them to recognise Encapsulation, Abstraction, Inheritance, Polymorphism
- Take a look at one of your codebases and find examples of classes with multiple responsibilities
Further reading / learning resources
- Supermarket Kata
- Duplicate Code ‘Code Smell’
- The Secret behind the Single Responsibility Principle on Hacker Noon
- Clean Code by Robert C Martin
Slides
The slides can be viewed from the link at the top of the repository.
Exercises
- Identify objects from business scenario (groups)
- Model a pack of playing cards (groups)
- Use abstraction to make the Snap! game work for normal cards (groups)
- Refactor the card model using inheritance (groups)
- Use polymorphism to implement Super Snap! using a mixture of card types
- Adapting Checkout Kata (pairs)
- Separating responsibilities from Checkout Kata (pairs)
Boot Camp Summary
Object Orientation
- Programming paradigms
- Why OO?
- How to think about objects
Source Control and GitHub
- Why source control
- Create, clone, commit, push
OO Principles
- Modelling some classic scenarios with objects
- Principles
- Encapsulation
- Apply to modelling
- Rewrite some existing code to remove inappropriate intimacy and coupling
- Code review some existing code
- Abstraction
- Apply to modelling
- Rewrite some existing code to abstract complexity
- Explain difference between encapsulation and abstraction
- Introduce to interfaces
- Polymorphism
- Apply to modelling
- Give some examples
- Inheritance
- Encapsulation
Single Responsibility Principle
- Cohesion
- Functional Decomposition
- Critiquing and adapting poorly implemented checkout kata