Re: Encapsulation

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



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
.



Relevant Pages

  • Re: Encapsulation
    ... accessibility to a single-level does not scale. ... the absence of decent encapsulation mechanisms. ... of assemblies without the ability to have a "nested ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Scale assembly
    ... The easiest way to scale all the geometry of an assembly is either to ... will have to insert a split feature and save out each body and then RMB ... Assemblies typically contain fasteners. ...
    (comp.cad.solidworks)
  • Re: ASP.NET - multiple applications sharing pages/ controls
    ... The approach that I have been using (small scale in house projects) is ... to create shared assemblies that I register in the GAC. ... In general I favor this to custom controls in many situations because I ... at times for .ascx files that I wish to reuse in other web applications. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: ASP.NET - multiple applications sharing pages/ controls
    ... The approach that I have been using (small scale in house projects) is ... to create shared assemblies that I register in the GAC. ... In general I favor this to custom controls in many situations because I ... at times for .ascx files that I wish to reuse in other web applications. ...
    (microsoft.public.dotnet.framework)
  • Re: Encapsulation
    ... accessibility to a single-level does not scale. ... I reduce the size of my assemblies then I increase the probability ... C++ still has "friend" and you can use that with .NET if you're still trying to write a .NET program. ...
    (microsoft.public.dotnet.languages.csharp)