Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why Use Interfaces
Message
De
12/01/2008 01:37:10
 
 
À
12/01/2008 01:13:08
Information générale
Forum:
ASP.NET
Catégorie:
Conception classe
Divers
Thread ID:
01278205
Message ID:
01281306
Vues:
26
Sorry, I've been operating on little sleep for the last couple days. Didn't mean to confuse.

- IF IFileSendFTP inherits the IFileSend interface your class could be declared as such:
Class myClass : IFileSendFTP

This class would still have to implement the methods created in both interfaces, due to the inheritence

- If IFileSendFTP did not inherit the IFileSend interface, your class could be declared as such:
Class myClass2 : IFileSend, IFileSendFTP


The class would end up looking the same in both scenarios other then the class declaration line.

The class author would need to know that he has to implement both interfaces in the 2nd case.

>>Having an interface inheriting from another is your choice. You might have a IFileSend interface. And when you designed it Email was the only requirement. Now certain classes will need to be FTP'ed.
>>
>>I've seen it both ways, where the author created another interface IFileSendFTP and either inherited the IFileSend interface, so your classes only needed to implement the IFileSendFTP. Or the interfaces were kept separate and the classes implemented both.

>
>Perry, anything that implemented the IFileSendFTP would still need to implement the interface of the IFileSend as well. Otherwise, what's the point of inheriting IFileSend?
>
>~~Bonnie

(On an infant's shirt): Already smarter than Bush
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform