    |

White Papers -
Articles
|
"Creating
Synergistic Components with Delphi"
|
James Callan
- KOG Webzine (Page 2)
|
Awakening Superb Awareness
Object-Oriented Programming (OOP) offers two
basic types of relationships between classes: links and aggregations. Links are peer-to-peer
relationships between classes that tend to avoid strong coupling between related
classes. Conversely, aggregation is when one class is constructed from other classes.
Both links and aggregations permit a class to use the public services provided by
its related classes.
When most people think of OOP they inevitably think of words like encapsulation,
inheritance, polymorphism and abstraction. Such terms principally relate to the features
and benefits that arise naturally from well-constructed aggregations between classes.
Thus, it should come as no surprise that links receive scanty attention. One reason
that programmers ignore links is that implementing links often requires a strict
object-oriented environment, based on pure message-passing such as SmallTalk.
Delphi, although a strongly typed environment, supports late binding via its Run
Time Type Information (RTTI) features. Delphi's RTTI features are sufficiently powerful
to support a variety of link relationships between classes. For certain design problems,
link-based designs are far superior to equivalent aggregation-based designs. Lazy
designs arise when designers choose a single, familiar technique or group of techniques
over better design alternatives. Awareness of the possible alternatives is what brings
superb designs. |
 
|