Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to determine if class is light or heavy
Message
From
22/07/2004 19:52:07
 
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00924940
Message ID:
00927242
Views:
26
“By designtime containership I mean something like: I have a cParse object that is designed to read files to be imported into a system. Each cParse object contains a cParseFile object whose job it is to convert a textfile into a cursor. Some file imports we run require 6 cParseFile objects the cParse object controls the calling he methods of the aggregated cParseFile objects. The cParseFile object gets dropped into a cImport object which also contains instances of cImportTable objects.”

There are two OOP design terms that may help: Composition and Aggregation.
When an object is added to another object at design time that is Composition. An example is a textbox being dropped on a form class. The contained object(s) lives and dies with the container.

If an object is added ( or not ) at runtime that is called Aggregation. This is what I think you are calling designtime containership based on your example. The contained object(s) can live for much shorter periods of time then the life of the container, typically just for part of a container method.

Now I term I used ( I think I’ve coined it, but maybe I have stolen it from someplace ) is runtime composition. What I mean by that is an object ( or more then one ) is added to a container early in the life of container, say via the init, and does not get released until late in the life say the release. In all practical sense it is composition, but technically it is aggregation because it is done at runtime.

Make some sense?

Anthony L. Testi
Previous
Reply
Map
View

Click here to load this message in the networking platform