Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why Use Interfaces
Message
From
11/01/2008 01:42:37
 
General information
Forum:
ASP.NET
Category:
Class design
Miscellaneous
Thread ID:
01278205
Message ID:
01281064
Views:
26
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform