Andrew R. Thomas-Cramer <ar**@shell.core.com> wrote:
Can I simply mark a class as internal, or should I change all its public
members to internal as well?
If I can mark the class only as internal, it makes modifications easy.
You can certainly mark a class as internal, but that's different from
making its public members internal. For instance, suppose you have a
class which implements a public interface. Even though the class may be
internal, an instance may still "get out of the assembly" by being
returned from a member in another (public) class. That instance would
have to be referenced by the interface it implements rather than the
class name itself (as the class isn't known to the outside assembly)
but the public methods can still be called.
If the public methods aren't implementing any interfaces, I suspect it
would only make a difference in a very few reflection cases which you
may not care about.
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet/
If replying to the group, please do not mail me too