Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Vfp50 - Subclassing more than once
Message
De
14/03/1997 09:21:42
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00023938
Message ID:
00024234
Vues:
43
>>>>> 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!

Hi Michael... That was a GREAT answer.... It help alot...

thanks again...
Robert Keith
Independent Developer
San Antonio, Texas
E-mail address:
rebelrob1@yahoo.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform