Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How can I create a new VCX of subclasses programatically
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00142974
Message ID:
00145192
Vues:
38
>Having a property or method that is not in the parent class can be indicative of a poor class design. The purpose of the highest class level is to define the public interface for all of its subclasses. Introducing a new property or method down the inheritence tree causes the interface to change within the particular class.

I would say that was a little extreme, Jim. All that's necessary is that the child is-a parent. It's not necessary that a parent is-a child (with respect to interface).

There are two main reasons to subclass: specialization and extension. Both reasons allow adding private/protected properties and methods. The second reason allows adding public methods.

What you're describing is called "class flattening," and can itself be indicative of bad design.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform