|
view as a single page
BY: Max Guernsey, III - Managing Member, Hexagon Software LLC
Introduction
Circular references are structures in which, by following some sequence of relationships longer than one, an object can refer to itself. The references do not have to be visible to the outside world, they just have to exist.
An example of a circular reference would be a traditional marriage: the husband has a relationship to his wife who, in turn, has a relationship back to her husband. Therefore, assuming no access control, the assertion husband.Wife.Husband == husband should, or at least can, be true.
These kinds of structures represent a unique construction challenge when they must be solidified as part of instantiation, as is often the case. An example of when a circular reference must be defined in construction would be a complex strategy object that must be able to recur. In such a case, the leaf strategy instances need a reference to the object that represents the logical strategy to which they are a party. The next section is an incomplete example of this kind of structure.
Related Links:
Common Components
|