Re: Encapsulation
- From: Jon Harrop <jon@xxxxxxxxxxxxxxxxx>
- Date: Sun, 25 May 2008 02:51:13 +0100
Peter Duniho wrote:
On Sat, 24 May 2008 15:34:23 -0700, Jon Harrop <jon@xxxxxxxxxxxxxxxxx>
wrote:
I don't think millions of lines of C# code in one assembly
is good at all.
Whether I have one line or a million lines, the idea of restricting
accessibility to a single-level (the assembly) does not scale.
That word "scale". You seem to think it means something other than what
it means.
I mean "scale" in the mathematical sense: as program size increases the
utility of that approach tends to zero.
Moreover, if
I reduce the size of my assemblies then I increase the probability
that "internal" cannot work because access is required from another
assembly.
Huh? If access is required from another assembly, you add the attribute
Arne suggested, so that the other assembly has access.
Sure but you are still trying to use a flat sequence of assemblies to
represent a hierarchy of constraints.
I agree it's not a perfect solution, but IMHO "friend" is overused
anyway. Most of the time I see someone wanting to make their classes
"friends", they are heading down the wrong path in the first place.
I am actually translating from ML and not C++. In ML, you can refine
interfaces (called signatures) hierarchically and the result is clear,
simple and scales flawlessly.
In any case, as has been explained: this is what C# offers. If you think
it's completely unsuitable to your needs, you need to use a different
language. C++ still has "friend" and you can use that with .NET if you're
still trying to write a .NET program.
I just want to be absolutely sure that there isn't some whizz-bang feature
in C# that beautifully solves that problem but that I had overlooked.
--
Dr Jon D Harrop, Flying Frog Consultancy
http://www.ffconsultancy.com/products/?u
.
- Follow-Ups:
- Re: Encapsulation
- From: Arne Vajhøj
- Re: Encapsulation
- References:
- Encapsulation
- From: Jon Harrop
- Re: Encapsulation
- From: Arne Vajhøj
- Re: Encapsulation
- From: Jon Harrop
- Re: Encapsulation
- From: Arne Vajhøj
- Re: Encapsulation
- From: Jon Harrop
- Re: Encapsulation
- From: Peter Duniho
- Encapsulation
- Prev by Date: Re: How to count value in a ArrayList
- Next by Date: Re: Encapsulation
- Previous by thread: Re: Encapsulation
- Next by thread: Re: Encapsulation
- Index(es):
Relevant Pages
|