Benny
Benny

Reputation: 8815

Physical or logical separate my dlls?

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?

Upvotes: 0

Views: 214

Answers (4)

Steven
Steven

Reputation: 172646

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.

Upvotes: 1

galford13x
galford13x

Reputation: 2531

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.

Upvotes: 2

Chris Marisic
Chris Marisic

Reputation: 33098

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

Upvotes: 1

Seb
Seb

Reputation: 2715

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.

Upvotes: 3

Related Questions