I put different component in different dll, then end up finding i am having too many dlls, should i put some in on开发者_StackOverflowe dll, but use namespace to separate them?
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.
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.
You can also use ILMerge in your build process so that you can combine many projects into a single DLL.
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.
精彩评论