Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Passing array property of an object
Message
 
À
05/04/1999 10:34:32
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00204115
Message ID:
00205213
Vues:
16
Bill,

Your is a common misunderstanding. You are actually doing tow things in one step and that is where the confusion comes in. You are creating a container class and you are exercising composition in one class definition and this causes a lot of potential problems.

If I want:
     --------------
    |              |
    |  <button>    |
    |              |
     --------------
A button inside of a container. I can create a container class, give it its proeprties and emthods and add the button to it in one class. Or I can create the container add its properties and methods. Then subclass that container and add the button (which ahs been fully defined in its own class).

The advantage of the latter approach is that I can have many containers with different buttons in them all as decendants of the same container superclass. This approach also clears up the owenreship of teh methods and properties. Those of the container belong to the container and those of teh button belong to the button.

In the former approach, the button in the container is not a class definition but rather is an object added to the class.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform