Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Aggregate class construction
Message
De
23/05/1999 23:16:10
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00221944
Message ID:
00221977
Vues:
10
Hi Terry ---

Owww...my head hurts :-)

Easy question first: The Class category is for classlibs and practical constructions thereof. The OOP category is, generally, for more theoretical discussions. Although there are no hard, firm rules, really.

Are you sure you're not confusing "aggregates" and "composites"? An aggregate is an object showing a relationship between related classes. Similar to a parent or superclass.

A composite class is a class that contains one or more objects. For example, if you had a form class with nav buttons on it. The forms instanced from that class would inherit the nav buttons and nav button behavior; the class itself would be a composite.

You may be overcomplicating your situation. As a a general principle, you want function to flow uphill, to the parent classes. It's easier in a child class to reroute or remove functionality than it is to add new functionality.

Also, if I understand you correctly on "level", the level is irrelevent in context. If I am adding a Textbox, for example, to a grandchild class (has a parent which has a parent), I can use the Textbox Base class or a subclass...depending on which is more applicable, to form the composite.

With composites, each part of the composite may be at different levels of abstraction, depending on the needs. Ideally, you are encapsulating function at the object level and minimizing dependencies, so you want to use the "level" of object applicable to the situation.


>If you were using a custom 3 level class hierarchy where each class on level 2 is based on a class in level one, and each class in level 3 is based on a class in level two how would you populate an aggregate class with members?
>
>For example, In level 2 I have a container subclass of the container class in _base.vcx let's say. Now I want to create in level 2 a subclass of the container class with some contained classes inside it. Should the new container subclass from level one or level two and should the contained classes subclass classes in level one or two?
>
>Assume level one and two classes are fairly similar in properties and methods at this time. One theory I might use is that since everything in level 2 is basically subclasses from level one, I should do the same with any class in that level, but if my new class is a specialization of its parent, then shouldn't I specialize off the current level? Or should a significant specialization of a level two class go into a second dimension vcx library?
>
>What's the difference between classes category and oop on the forum?
>
>TIA
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform