Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Non-visual parent source
Message
 
À
25/05/1999 07:55:33
Kenneth Downs
Secure Data Software, Inc.
New York, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00222349
Message ID:
00222539
Vues:
22
Hello Kenneth,
Thanks for the response. So FormEdit exists in your level3 library with parent in level2. Okay. Yes my 3 levels are for the same reasons as yours seem to be. If I put FormEdit in level3 and subclass Forms3.MyBaseFormsClass though it also gives FormEdit the qualities you mentioned. Which is best is my question. Once a person has a Forms3.MyBaseFormsClass on level3 library, should one not bypass it by subclassing back to level2? If I subclass FormEdit from level3, I can no longer customize Forms3.MyBaseFormsClass without affecting FormEdit whereas if I subclass from Forms2.MyBaseFormsClass I can change Forms3.MyBaseFormsClass without affecting FormEdit. Which way is best or currently being used. I'm one of those trying to decide whether to buy a framework or continue creating my own.

>Terry,
>
>In order to answer your question, it might help to know a little more about why you have three tiers. I myself use three levels, but for a very specific reason: The "bottom" tier contains my framework code. The middle tier can be safely experimented with w/o affecting proven classes at the bottom tier, while the top tier can contain project-specific changes.
>
>If this is what you are doing, the following inheritance scheme works very well for me.
>
>Consider three class libraries, Forms1.vcx, forms2.vcx, and forms3.vcx, representing the bottom, middle, and top tiers of the scheme. Now consider Forms1.MyFormBaseClass, which contains all of the properties and methods that I want to have in all of my forms in all projects. This would naturally inherit to Forms2.MyFormBaseClass2 (don't ever name two classes in different libraries the same thing!), and on to Forms3.MyFormBaseClass3.
>
>Now I want "FormEdit", which inherits from MyFormBaseClass. Question is, from which library? The answer is to create Forms1.FormEdit as a subclass of Forms2.MyFormsBaseClass2. This achieves the desired affect of having all properties and methods achieved at the bottom level, while changes made at the middle level will still propagate "backwards" to the bottom level as well.
>
>This "zig-zagging" inheritance, as I call it, offers the ultimate in flexibility and safety for your roll-your-own framework.
>
>Hope this helps.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform