make Internal access more logical and less physical

  • Thread starter Thread starter Mountain
  • Start date Start date
M

Mountain

If a large framework (or library, application, etc.) has optional parts
and some users may not want all parts, it would make sense to break the
framework into separate physical assemblies. However, if internal
access is specified in the monolithic framework, a problem arises
because changing internal access to public changes the design
intention. Something other than public is required, yet internal
doesn't work anymore (even though the logical design of the code has
not changed).

The large framework is still logically one unit, but it has been
physically arranged as two or more assemblies strictly for efficiency
or flexibility. Why should we not have a way to define an internal
access level for the _logical_ unit? In an imaginary future version of
C#, this might be something like the internal access modifier scoped by
namespace. . .

Is there any way to accomplish what I'm after in C# 2.0? Thanks.
 
Mountain said:
Why should we not have a way to define an internal
access level for the _logical_ unit? In an imaginary future version of
C#, this might be something like the internal access modifier scoped by
namespace. . .

Is there any way to accomplish what I'm after in C# 2.0? Thanks.

There is. Look up friend assemblies in the MSDN documentation.

-- Barry
 
Mountain said:
If a large framework (or library, application, etc.) has optional parts
and some users may not want all parts, it would make sense to break the
framework into separate physical assemblies. However, if internal
access is specified in the monolithic framework, a problem arises
because changing internal access to public changes the design
intention. Something other than public is required, yet internal
doesn't work anymore (even though the logical design of the code has
not changed).

The large framework is still logically one unit, but it has been
physically arranged as two or more assemblies strictly for efficiency
or flexibility. Why should we not have a way to define an internal
access level for the _logical_ unit? In an imaginary future version of
C#, this might be something like the internal access modifier scoped by
namespace. . .

Is there any way to accomplish what I'm after in C# 2.0? Thanks.

Yes. There's even a way to accomplish it in 1.0.

While most assemblies are a single PE file, this is not a requirement:
You can break your assembly into multiple modules, united by a
manifest. Internal visibility applies across the whole assembly, but
you can have different contents in different builds.

--

..NET 2.0 for Delphi Programmers <http://www.midnightbeach.com/.net>

Delphi skills make .NET easy to learn
Being printed - in stores by June
 
Back
Top