Assembly and source - design question

  • Thread starter Thread starter Donal McWeeney
  • Start date Start date
D

Donal McWeeney

I have a big Visual Studio class library project from which I create an
assembly. This assembly for example might contain 100 public entry points
(for example custom server controls) and a load of shared back-end library
code that they use.

I now have a need to create 2 new separate small assemblys from the same
code base, with one public entry point in each. For example I want to bundle
2 public server controls, each into their own individual assemblys. These
assemblies will also be obscured and installed as standalone components.

So the question - what is the best way to go about achieving this:
- from the perspective of visual studio project structures
- visual sourcesafe code sharing
- assembly merging
- usage of #idef directives etc

Thanks

Donal
 
Donal,

From my perspective, you should not be sharing code files between
assemblies. What you should be doing is creating an assembly with the logic
you desire, and then referencing that assembly from the new assemblies you
want to use. That being said, here are your answers:

- from the perspective of visual studio project structures

You will add another project with one class in it, and reference the
original class library.

- visual sourcesafe code sharing

Not an issue, since you will not be sharing the code, you will be
referencing the assemblies that have the functionality you need.

- assembly merging

Do you mean using multiple modules, or actually merging two assemblies
(which is not possible, AFAIK).

- usage of #ifdef directives

Don't do it. I've seen very few situations where ifdefs lead to more
clear/concise/easily-maintained code. You are only asking for trouble here.

Hope this helps.
 
Hi Nicholas,

Thanks for the answer - I agree in principle with what you say...

However one big issue I have is all the code in my "main" class library
assembly will be obscured, so anything I want my external assembly to see
will have to be made public - otherwise it will be renamed - and I dont
really want to do this as it defeats the process of the obscuring.

The second issue is that for 90% of installations my "main" assembly gets
installed in the GAC - I dont want to have to install an additional number
of smaller assemblies to the GAC also. Splitting the code into smaller
assemblies also has a slight performance impact.
Do you mean using multiple modules, or actually merging two assemblies
(which is not possible, AFAIK).

I thought I had read somewhere that you could merge assemblies!!! Must have
been a delusional moment...

Thanks

Donal
 
Hi Kevin,

Thanks for the pointers - I knew I came across them somewhere...

Thanks

Donal
 
You're welcome, Donal.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
Back
Top