Re: How to hide an interface in C#
From: Jon Skeet [C# MVP] (skeet_at_pobox.com)
Date: 10/18/04
- Next message: Jon Skeet [C# MVP]: "Re: How to hide an interface in C#"
- Previous message: Phil Williams: "RE: help on getting started in c#"
- In reply to: Robert Jordan: "Re: How to hide an interface in C#"
- Next in thread: Rakesh Rajan: "RE: How to hide an interface in C#"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 18 Oct 2004 22:20:20 +0100
Robert Jordan <robertj@gmx.net> wrote:
> > On the other hand, it *would* make sense to be able to specify an
> > internal assembly implementation. It's a bit of a shame that's not
> > allowed, as it could be useful sometimes.
>
> Think about the semantics of those interfaces:
>
> // assembly A
> public interface IContract {
> void Method()
> internal void InternalMethod();
> }
>
> // assembly B
> class C : IContract {
> public void Method() {}
> // InternalMethod() cannot be implemented, so C doesn't really
> // implement IContract.
> }
>
> So IContract must be made non-implementable from outside.
> A quite unilateral contract, isn't it? :-)
That's not quite what I was going after. I was suggesting something
like a class which from inside the assembly could be regarded as
implementing IList, but shouldn't be publicly implementing IList. That
can't be done, as far as I can see.
-- Jon Skeet - <skeet@pobox.com> http://www.pobox.com/~skeet If replying to the group, please do not mail me too
- Next message: Jon Skeet [C# MVP]: "Re: How to hide an interface in C#"
- Previous message: Phil Williams: "RE: help on getting started in c#"
- In reply to: Robert Jordan: "Re: How to hide an interface in C#"
- Next in thread: Rakesh Rajan: "RE: How to hide an interface in C#"
- Messages sorted by: [ date ] [ thread ]