Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Subclass a class
Message
De
02/07/2004 12:55:22
Mike Yearwood
Toronto, Ontario, Canada
 
 
À
02/07/2004 12:48:12
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00920057
Message ID:
00920198
Vues:
21
Hi Fred

The direct-line parent classes must be included, there is no getting around that. However, other classes are being included in the project. That can be avoided.

>Hi Mike,
>
>But how does that help in this situation? They would still need to provide the lower level class libraries, even if they are individualized.
>
>
>>Hi David
>>
>>This is another example of how arbitrary class-classlib groupings are problematic. The problem would be significantly lessened by keeping classes in separate classlibs unless there is a good reason to combine them.
>>
>>>Chris,
>>>
>>>The classlib is a unit, if you use a single class in it you get them all in the project and app. If you find that you are getting lots of classes you don't want, you'll have to repackage your classes into different classlibs. I can't say that I've seen anyone organize the classlibs like you have. Say you need to create a special button that only AppX needs and you put that class in your button classlib. This will cause all of your apps that use any button to now have the special button included even though you don't use it.
>>>
>>>I think most people do the classlib packaging by the first couple of levels of inheritance and then by subsystem and/or project packaging. So all of the first level subclasses of the VFP Baseclasses are put into one classlib. For me that's cControls, it includes cTextbox, cCommandButton, cEditbox, cGrid, cListbox, cCustom, etc. This level is used for two puropses:
>>>
>>>1) isolation from changes in the VFP Baseclasses.
>>>2) changing the things you don't like about the VFP Baseclasses.
>>>
>>>Then I use a functional and subsystem/project basis to create my other classlibs. If I develop a class for AppZ that ends up being useful elsewhere I'll promote it up out of the project classlib to a classlib that is shared across projects or create a new classlib for it.
>>>
>>>>I have the following custom class:
>>>>
>>>>1 vcx file for all my textbox controls
>>>>1 vcx file for all my commandbutton controls
>>>>1 vcx file as a custom class based on a control class. Inside has a textbox from the textbox.vcx class and one commandbutton from the commandbutton.vcx class.
>>>>
>>>>When I include this custom class based on the control class in a new project class (subclassing) and rebuild my project, the project includes the textbox and commandbutton class in it.
>>>>
>>>>How can I do that only the custom class that i'm subclassing appears in the project and not all the classes that this subclass class is based on.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform