Content deleted Content added
→Criticism: Bring Paul Graham quote references together. |
m →Introduction: Unbold |
||
Line 32:
Chapter 1 is a discussion of [[object-oriented]] design techniques, based on the authors' experience, which they believe would lead to good object-oriented software design, including:
* "Program to an
* [[Composition over inheritance]]: "Favor '[[object composition]]' over '[[Inheritance (computer science)|class inheritance]]'." (Gang of Four 1995:20)
Line 56:
To the authors, 'delegation' is an extreme form of object composition that can always be used to replace inheritance. Delegation involves two objects: a 'sender' passes itself to a 'delegate' to let the delegate refer to the sender. Thus the link between two parts of a system are established only at runtime, not at compile-time. The [[Callback (computer science)|Callback]] article has more information about delegation.
The authors also discuss so-called
The authors admit that delegation and parameterization are very powerful but add a warning:
Line 62:
:"Dynamic, highly parameterized software is harder to understand and build than more static software." (Gang of Four 1995:21)
The authors further distinguish between '[[Object composition#Aggregation|Aggregation]]', where one object 'has' or 'is part of' another object (implying that an aggregate object and its owner have identical lifetimes) and
The authors employ the term 'toolkit' where others might today use 'class library', as in C# or Java. In their parlance, toolkits are the object-oriented equivalent of subroutine libraries, whereas a '[[Software framework|framework]]' is a set of cooperating classes that make up a reusable design for a specific class of software. They state that
==Case study==
|