Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Interfaces
Message
De
02/02/2008 20:15:39
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, États-Unis
 
 
À
02/02/2008 19:18:40
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
Versions des environnements
Environment:
VB 8.0
Divers
Thread ID:
01288224
Message ID:
01288587
Vues:
14
So it would be a good idea to implement an interface containing Load, Save, LoadByID, and methods like that?

>Simplicity does not in and of itself mean that you shouldn't use interfaces.
>
>One reason to use interfaces is as you noted before to enforce contracts among classes. So that if they implement a certain behavior it will be done thru consistent method calls among all those classes.
>
>When you notice that a substantial number of your classes, even thou they might be totally unrelated, implement a similar feature, then an interface might be called for. So you, or anyone looking at your system, can be rest assured that the feature is called in a similar fashion in any new class that might get added.
>
>>>>>>I think the tread you were looking for is this one: Thread #1278205. Now, I am out of this thread <g>
>>>>>
>>>>>BTW, thanks for the link!

>>>>
>>>>That Thread got side-tracked a bit with the talk about "simulating mulitple inheritance", but there was still a lot of useful opinions.
>>>>
>>>>And the example that Bruce gave in *this* thread of how he's using Interfaces is an excellent example.
>>>>
>>>>If you're still having a hard time getting your head around it, ask a few more questions. We'll get you straightened out! <g>
>>>>
>>>>~~Bonnie
>>>
>>>Bonnie,
>>>I think the problem I am having is that I only design simple classes and I don't need the advance functionality that you guys seem to be doing. So I assume I shouldn't use an interface for every class?
>>>
>>>Thanks,
>>>Mike
Very fitting: http://xkcd.com/386/
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform