Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why Use Interfaces
Message
De
11/01/2008 01:42:37
 
Information générale
Forum:
ASP.NET
Catégorie:
Conception classe
Divers
Thread ID:
01278205
Message ID:
01281064
Vues:
42
Pete,

Are you asking me if the IFarm interface can inherit from the ICircus interface? Sure, why not? Although, in this particular example, it doesn't make much sense, because you're saying that Farm animals are also Circus animals.

~~Bonnie



>Hi Bonnie, I've been following this thread and thought I'd throw this into the arena, is the following interface inheritance "the done thing" when designing interfaces ? ( code copied from your example )
>
>
>
>public class LivingThings
>{
>    public virtual void FeedMe()
>    {
>
>    }
>
>}
>
>public interface ICircus
>{
>    void PerformTricks();
>    void TalkToMe();
>}
>public interface IFarm : ICircus
>{
>    void EatMe();
>
>}
>public class TrickGoats : LivingThings,IFarm
>{
>    public override void FeedMe()
>    {
>
>    }
>
>    public void PerformTricks() { }
>    public void TalkToMe() { }
>    public void EatMe() { }
>}
>
>
>
>many thanks in advance
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform