tags:

views:

53

answers:

4

I put different component in different dll, then end up finding i am having too many dlls, should i put some in one dll, but use namespace to separate them?

+3  A: 

You don't have to build one assembly for one namespace. Maybe you could use nested namespaces within one assembly. Just try to avoid splitting a namespace between several assemblies, it's harder to understand when you enter the project afterwards.

Seb
at least i should put what is close in one dll, right?
Benny
Yes. The class defined in an assembly should tend to the same purpose.
Seb
+1  A: 

You can also use ILMerge in your build process so that you can combine many projects into a single DLL.

Chris Marisic
+2  A: 

Yes, Personally when building some library, I tend to put all related functions within a single assembly. The basic rule of thumb I go by is if a single DLL depends on another DLL that is related in any way, I will generally combine them into one DLL. That does assume of course that both projects are being developed concurrently.

galford13x
good idea. thanks for sharing.
Benny
+1  A: 

I usually use DLL's to enforce architectural constraints. For instance, I don't want my data layer to know anything about my business layer. When this results in too many assemblies (and long time to compile) moving them together might be wise. In that situation you could a tool like NDepend to check your architectural constraints.

Steven