Re: "Abstract" interface ?
- From: "Steve B." <steve_beauge@xxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 26 Jul 2005 16:13:06 +0200
thanks for these answers.... I 'm a little disappointed :)
"ernesto bascón pantoja" <ebasconp@xxxxxxxxx> a écrit dans le message de
news: %23d$MxSWkFHA.4024@xxxxxxxxxxxxxxxxxxxxxxx
>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
>>>
>>>
>>>
>
>
.
- References:
- "Abstract" interface ?
- From: Steve B.
- RE: "Abstract" interface ?
- From: Cowboy (Gregory A. Beamer) - MVP
- Re: "Abstract" interface ?
- From: ernesto bascón pantoja
- "Abstract" interface ?
- Prev by Date: Re: Running VS2005 web app on framework 1.1?
- Next by Date: Re: "Abstract" interface ?
- Previous by thread: Re: "Abstract" interface ?
- Next by thread: Re: "Abstract" interface ?
- Index(es):
Relevant Pages
|