Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Vfp vs Vb
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00283708
Message ID:
00284746
Vues:
19
>John,
>
>Very good arguments, but you didn't discuss the benefits of MULTIPLE interfaces.
>

Here's one.. Imagine you have an abstract entity class and an abstract printing class. I know want to create a customer class capable of printing out a variety of reports. With multiple interfaces, I can create a customer class that implements both the entity and printing classes.


>Also, inheritance is not necessary for polymorphism (a common misconception). Polymorphism simply says that two different operations can have the same name (Ad Hoc Polymorphism), and that can be done in FoxBASE. Well with a good deal of library management.
>

>The other polymorphism is inherent polymorphism, which is descriptive of inheritance and not a result of inheritance. Inherent polymorphism says that all members of a class share some or all of the properties and methods of the superclass.
>

But in the OO world, the common way of implementing polymorphism is through inheritance. At least, most examples illustrate it in that light. Perhaps that is why inheritance is the most used/abused feature in OOP.

>I know this is nit picking, but I just wanted it to be said lest others start thinking that inheritance is what allows polymorphism. In fact, the opposite is true, polymorphism is what defines inheritance.
>

No.. those are good points to bring up.

>Inheritance, when used well, is often only defining an interface. When misused it is specialize behaviors, something that is much better served through strategy and bridge patterns among others.
<

Exactly, and I think that is the point the Walter Meester is attempting to make here...
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform