The first chapter uses Delphis GUI generator to start looking at the internal structure of an object. The second chapter looks at RAD-generated inheritance and at the hierarchy of standard user interface components. The third chapter helps the novice OO programmer to write programmer generated classes and the fourth chapter looks at ways of accessing an object and its data.
Chapter two introduces inheritance for reuse through subclassing by presenting VFI and the VCL library supplied with Delphi. Inheritance also provides the possibility of subtyping and the power of polymorphism and this is introduced in chapters four and five, using Delphis standard Sender parameter as a starting point. Chapter six draws together the material from the preceding chapters by stating several anti-patterns that highlight potential pitfalls in using inheritance.
Along with polymorphism, the concept of cooperating objects is crucial to OO. Object cooperation in various forms is a theme running from chapter seven through to the end of the module.
The concepts of polymorphism and cooperation are consolidated by the exploration, from chapter nine onwards, of a variety of OO patterns. The following table shows the patterns well cover in this module along with the OO programming concepts these patterns allow us to explore:
Pattern - Concepts
~Immutable - Encapsulation and visibility (private, protected and public fields)
~Sender Argument - Low coupling; Callbacks
~Adapter - Reuse; Implicit delegation; Enabling substitution with unrelated class
~Facade - Low coupling; Implicit delegation; Packaging for simplification
~Law of Demeter - Low coupling; Implicit delegation
~Player-Role - Class definition, distinguishing between attributes and roles; Delegation; Packaging for future evolution; Changing associations dynamically
~Strategy - Packaging for variability (reducing coupling) ;
Polymorphic substitution
~Template method - Packaging for variability (reducing coupling) ; Polymorphic substitution; Implementation at different hierarchical levels
~Association class - Class definition; Link (association) information
~Factory method and Abstract Factory - Object manufacture; Separation of concerns
~Singleton - Object manufacture
~Mono State - Class and object data fields
~Decorator - Polymorphic recursion
While contrasting subclassing and subtyping we also consider several inheritance antipatterns.
The fundamental principles of patterns are presented textually and graphically (through words and UML class diagrams, object diagrams and sequence diagrams) and the implementation through detailed worked examples, allowing the student to consolidate the concepts by considering two different perspectives. Using these diagrams brings familiarity in reading class, object and sequence diagrams. This helps develop representational literacy and indicates some of their strengths and limitations.

