Information générale
Catégorie:
Programmation Orientée Object
“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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement