Re: "Abstract" interface ?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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
>>
>>
>>


.



Relevant Pages

  • opening twice the same device file ...
    ... i need a little clarification to fully understand what is going on ... which provides file_operations interface (fops) ... int (struct inode * inode, ...
    (comp.os.linux.development.system)
  • Re: reiser4 plugins
    ... inodes in the attrfs. ... I prefer that interface over xattr or openat. ... Not sure I like using inode numbers, ... You can still symlink. ...
    (Linux-Kernel)
  • Re: "Abstract" interface ?
    ... > public abstract class DestinationBase: ... >> internal interface IDestination: INode ... >> internal interface ISource: INode ...
    (microsoft.public.dotnet.framework)
  • Re: "Abstract" interface ?
    ... "Error 1 Inconsistent accessibility: base interface 'Core.INode' is less ... internal interface INode ... public interface IDest: INode ...
    (microsoft.public.dotnet.framework)
  • "Abstract" interface ?
    ... I have 3 interfaces in my app in order to allow my app to be extensible. ... IDestination: INode ... ISource: INode ...
    (microsoft.public.dotnet.framework)