Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing array property of an object
Message
 
To
05/04/1999 10:34:32
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00204115
Message ID:
00205213
Views:
15
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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform