Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to determine if class is light or heavy
Message
De
22/07/2004 19:52:07
Anthony Testi
Fabtrol Systems Inc.
Eugene, Oregon, États-Unis
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00924940
Message ID:
00927242
Vues:
24
“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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform