Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Vfp50 - Subclassing more than once
Message
 
To
13/03/1997 08:55:47
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00023938
Message ID:
00024185
Views:
44
>>>> Can you subclass from more than one parent class(form)?
>>>> Can a subclass have two parents of the same type (form)?
>>>>
>>>you cannot have multiple inheritance in VFP (inherit form several parents)
>>>you can however subclass a form and inside it have a subclassed container
>>>IMHO this will simulate waht you want
>>>
>>>Arnon
>>
>>You might also consider using Custom class objects to encapsulate properties and methods that can then be added into separate classes that don't share a common base.
>
>thanks for your answer...
>Could you give me an example?

I'll give you an analogy: suppose you want to build a zoo of various classes of animals. And suppose that there are certain aspects that are common to many species, but not all, and they occur in various diverse combinations. You don't want to create a bunch of redundant properties and methods in each different class, but you also find it awkward to fit everything into a single neat heirarchy. So you create a Custom class object that represents a circulatory system, another one for a nervous system, a tail, a tusk, etc. Then you build your animals by starting from a suitable base class and dropping in the applicable custom class member objects. These custom objects are not containers, and they are not visual objects. They are just a convenient way of packaging a logical collection of properties and methods that can be attached to different PARENT objects. I hope this silly example helps!
Montage

"Free at last..."
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform