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:
01279566
Vues:
32
> but if I had a choice I'd do the original design so that it avoids MI.

Do you always have the choice (even with hindsight)?
Assume these four entities (with the methods they need to implement):

Person
:FeedMe
:WaterMe

Cow
:FeedMe
:WaterMe
:EatMe

Cake
:EatMe

Deadly Nightshade
:WaterMe

What will be your class structure?
Given a collection of such objects how do you know which are edible?
What if the calling entity is sometimes a vegetarian?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform