This tip will provide you information on how to design and what are the considerations required when designing a solution structure for your application.
Recently, we are working on a new project and the development team is assembling to setup the solution structure and we have identified our layers and utilities, helpers, logs, audits, components, etc. and after lots of discussion we have created multiple directories in a single solution instead of multiple projects in a single solution.
We have selected multiple directory structure instead of multiple project structure. So here are the pros and cons.
Why Many Projects in a Single Solution are Not Good for Solution Health?
- Increases complexity and maintainability
- Slower compile time/build time
- Longer time required to load the solution
- Complexity in deployment
- Shuffling between projects when coding and finding references between projects is not developer friendly
- Cyclic dependency between projects is a concern
When Multiple Projects Make Sense?
- Reusability, are you developing libraries that are also used by other applications in your organization?
- Are you using different programming languages in your applications?
- Is your application really required to deploy different portions of your source code independently?
Then multiple projects can make a little sense.
How Single Projects Make Life Easier?
- No need to worry about cyclic dependency
- Improved solution load time/build time/compile time
- Friendly directory structure in your solution
- Easy to maintain and deploy