SPA Conference session: Replacing inheritance with composition

One-line description:See how to replace inheritance with composition, and why you might want to
 
Session format: Instructor lead 150 minute wor [read about the different session types]
 
Abstract:Inheritance is one of the defining characteristics of object-oriented programming. However, overuse of inheritance makes code more difficult to understand, limits how it can be reused and leads to a muddling of concerns. Developers either don't think about replacing inheritance with composition, or think it'll take too much effort. This workshop takes some code from an Open Source project and leads participants through replacing an inheritance hierarchy in it with composition. Participants will see that it is easy enough to do and leads to improved code. This will encourage participants to replace inheritance with composition in their own code bases, leading to improved code and more tea breaks.
 
Audience background:Developers. The workshop will be hands-on using Java, so participants must be comfortable working in Java.
 
Benefits of participating:Participants will learn some tips about how to replace inheritance with composition and will see both the benefits of it, and that it's not so difficult to do.
 
Materials provided:An example code base
 
Process:First, I'll do a bit of presenting about inheritance vs composition, then a quick description of the code participants will be working with. Participants will then take the code and be lead through steps to replace inheritance with composition. There will be some discussion about what steps are needed and how they can be achieved both during and at the end of the workshop. I will tell participants what steps to do during the workshop based on what participants suggest and on experience of having gone through the exercise previously. At the end of the workshop, there will be some discussion about whether the benefits of replacing inheritance with composition have been justified, and what other approaches to the refactoring could have been taken.
 
Detailed timetable:Not decided yet. I have started looking for some example code. The detailed timetable (and the very session itself) will depend on whether finding something suitable.
 
Outputs:refactored code. stuff in brain.
 
History:not presented this before. Might find co-presenter(s) to help.
 
Presenters
1. Ivan Moore
Team Optimization
2. Mike Hill
Silvacre Limited
3.