When designing an application, at what point should the various layers (such as Presentation, Business Logic, and Data Access) be separated into different assemblies?
When designing an application, at what point should the various layers (such as Presentation,
Share
Mainly you’ll be distirbuting classes in different libraries if you want to provide your product in a way you can choose some final user wouldn’t have access to the entire project’s classes.
Think in a client-server application. Why you would want to distribute server classes to your customer if you’ve a cloud computing scenario? You’d prefer to distribute presentation and service client classes, packaged in server-independent assemblies. That’s a good security practice too.
Another good point to separate in assemblies is to avoid to load a large assembly to an application domain (AppDomain). For example, if the usage of your program doesn’t require image processing overtime, but maybe, a single operation per day would need to require imaging classes, you’re saving processing time – when loading a large assembly to application domain – and memory because your application doesn’t require an assembly that has all and, at the end of the day, your application has fewer memory usage.
In the arquitectural point of view, separating in assemblies would enforce good practices, thanks to the fact you’ll be aware of not mixing layers because, for example, you shouldn’t require business assemblies in your presentation assembly, so, no one has access to business logic directly from the user interface.
Finally, in terms of deployment, you save time as you can update a modular application with specific assemblies, easing the upload process or auto-update process, because download times are reduced, saving network traffic.