Re: Nested classes
From: B0nj (b123_at_nj)
Date: 05/29/04
- Next message: CBFalconer: "Re: Chinese Syntax"
- Previous message: clintonG: "Re: Books - C# for beginning programmers ?"
- In reply to: Stoitcho Goutsev \(100\) [C# MVP]: "Re: Nested classes"
- Messages sorted by: [ date ] [ thread ]
Date: Sat, 29 May 2004 18:11:47 +0100
The reason behind the question, is that
the whole point of encapsulation is that functionality
is not exposed. Admittedly there would not be mileage
in going to great lengths to 'shield' it in this case,but i like
the sound of the interface idea.
"Stoitcho Goutsev (100) [C# MVP]" <100@100.com> wrote in message
news:Ou8quhPREHA.1392@TK2MSFTNGP09.phx.gbl...
> Brad,
> It completely make sense to me. If the property is public that means
> evetybody can use it, but how you can use it if the type of the property
is
> not accessible. The type of the property has to have the same visibilty or
> to be more visible the the property itself. The same goes for method
> parameters, and return values. Actually it goes for each public member.
> --
>
> Stoitcho Goutsev (100) [C# MVP]
>
>
> "Brad Williams" <spam@spam.com> wrote in message
> news:c97rcb$k5r$1@news01.intel.com...
> > Switch to VB.NET? ;)
> >
> > The problem is not with nested classes per se, you get the same problem
if
> > you un-nest the class. The limitation is that the type of a property
must
> > be "as accessible" as the property itself. Found this in 3.5.4:
> > http://tinyurl.com/33jec "The type of a property must be at least as
> > accessible as the property itself." Same is true for the return type
and
> > formal param types of methods, operators, etc.
> >
> > Seems to me if the only thing public in your public nested class is this
> > indexer, then that's really very little extra baggage in the public view
> of
> > your assembly. I don't know what else could be done cleaner.
> >
> > Brad Williams
> >
> >
>
>
- Next message: CBFalconer: "Re: Chinese Syntax"
- Previous message: clintonG: "Re: Books - C# for beginning programmers ?"
- In reply to: Stoitcho Goutsev \(100\) [C# MVP]: "Re: Nested classes"
- Messages sorted by: [ date ] [ thread ]