Reputation: 11309
We have an enterpise web application that did consist of 4 compiled components (DLLs). Over a year ago, we began implementing more granular components in an attempt to isolate functionality, reduce coupling and reduce the risk of recompiling and deploying massive chunks of code. While no one argues that this approach has given us MUCH improved flexibility and speed to market when adding new functionality and patching bugs, the applications now consists of nearly 40 dlls. We have a naming convention that works well for identifying our components.
My question is: Is there any down-side(Performance, maintenance, etc...) to having an application with many dlls?
Edit: We are exploring the option of refactoring code into larger components which I think might be a regression of sorts...
Upvotes: 25
Views: 5281
Reputation: 456687
Don't forget about ILMerge. It works quite well if you want the multiple DLLs for development (different projects) but one EXE for deployment (faster to load, easier to deploy).
The downside of ILMerge is that it'll fail in some dynamic loading scenarios, e.g., creating an instance of a type by (string) name. So, ILMerge may or may not be feasable, depending on your IoC provider.
Upvotes: 4
Reputation: 131726
Separating independent functional domains into individual DLLs is generally a good thing. It helps introduce the potential for reuse and help mitigate the introduction of inappropriate coupling between the internal implementations of classes.
However, there are downsides to introducing multiple assemblies as part of a system:
Upvotes: 12
Reputation: 273284
My question is: Is there any down-side(Performance, maintenance, etc...) to having an application with many dlls?
A downside with many DLLs ? No
A downside with too many DLLs ? Sure.
So how many is too much?
An assembly is an means of organization, like namespaces and classes. Namespaces define logical boundaries, assemblies physical boundaries.
You should try to keep assemblies coherent, and view them as system modules.
And yes, there would be a (small) performance problem if you had hundreds of them. But with 40, I don't see a problem.
Upvotes: 16
Reputation: 54744
The sorts of issues that get worse with more DLLs are:
The advice I follow is to use DLLs to organise your deployment, and namespaces to organise your code. If you find that you always release a given set of DLLs together, you might as well merge them.
Upvotes: 6
Reputation: 1038930
Maintenance - no, performance - yes. The more assemblies that need to be loaded the slower your application will start. For each assembly that needs to be loaded into the AppDomain the loader needs to perform a series of verifications.
Upvotes: 7