Re: "Abstract" interface ?
- From: "ernesto bascón pantoja" <ebasconp@xxxxxxxxx>
- Date: Mon, 25 Jul 2005 18:02:43 -0400
I think you should provide abstract implementation of your interfaces like
public abstract class DestinationBase : IDestination;
public abstract class SourceBase : ISource;
and to expose only DestinationBase and SourceBase in your APIs.
Best regards,
Ernesto
"Cowboy (Gregory A. Beamer) - MVP" <NoSpamMgbworld@xxxxxxxxxxxxxxxxxx> wrote
in message news:310B7C7F-7E23-41AE-B34E-69A461E801D9@xxxxxxxxxxxxxxxx
> None that I can think of.
>
> Interfaces represent contracts. By their very nature, you must expose all
> "parent" contracts in an inheritance chain with the same level of
> exposure.
> It is possible to go this direciton:
>
> public interface INode
> {
> }
>
> internal interface IDestination : INode
> {
> }
>
> internal interface ISource : INode
> {
> }
>
> but not this direction:
>
> internal interface INode
> {
> //Methods
> bool Method1();
> }
>
> public interface IDestination : INode
> {
> }
>
> public interface ISource : INode
> {
> }
>
> There is no abstract keyword for interfaces as interfaces are abstract by
> nature (ie, no implementation).
>
> --
> Gregory A. Beamer
> MVP; MCP: +I, SE, SD, DBA
>
> ***************************
> Think Outside the Box!
> ***************************
>
>
> "Steve B." wrote:
>
>> Hi,
>>
>> I have 3 interfaces in my app in order to allow my app to be extensible.
>>
>> INode,
>> IDestination : INode
>> ISource : INode
>>
>> I do not want developpers to implement INode, but at least IDestination
>> or
>> ISource.
>> The keyword "abstract" is not allowed for interfaces. Is there any way to
>> reach my goal ?
>>
>> Thanks,
>> Steve
>>
>>
>>
.
- Follow-Ups:
- Re: "Abstract" interface ?
- From: Steve B.
- Re: "Abstract" interface ?
- References:
- "Abstract" interface ?
- From: Steve B.
- RE: "Abstract" interface ?
- From: Cowboy (Gregory A. Beamer) - MVP
- "Abstract" interface ?
- Prev by Date: C# Clipboard problem
- Next by Date: How to make rectangles on aweb page?
- Previous by thread: RE: "Abstract" interface ?
- Next by thread: Re: "Abstract" interface ?
- Index(es):
Relevant Pages
|