Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why Use Interfaces
Message
Information générale
Forum:
ASP.NET
Catégorie:
Conception classe
Divers
Thread ID:
01278205
Message ID:
01278244
Vues:
22
Well, nobody mentioned this, so you will hear it from the less appropriate person, but Interfaces are also a way to get some pseudo multiple inheritance (which it can be also bad design) for example (and it will probably stink) You might have two classes, Boat and Car, both deriving from Vehicle but now someone brings you a Car that moves in the water (or a boat that moves in the land), problem is you can not derive the new class from both (some languages do allow to do so) so the Interfaces come to the rescue, you could define a class CarBoat from Vehicle that implements IBoat and ICar. Well, that is a crude explanation, someone will give you a better example and explanation.
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform