When spliting a solution in to logical layers, when is it best to use a separate project over just grouping by a folder?
相关问题
- How to know full paths to DLL's from .csproj f
- Importing NuGet references through a local project
- Visual Studio 2019 - error MSB8020: The build tool
- 'System.Threading.ThreadAbortException' in
- VS2017 RC - The following error occurred when tryi
相关文章
- How to show location of errors, references to memb
- How to track MongoDB requests from a console appli
- Visual Studio Hangs on Loading UI Library
- How to use Mercurial from Visual Studio 2010?
- Copy different file to output directory for releas
- Edit & Continue doesn't work
- “Csc.exe” exited with code -1073741819
- Visual Studio: Is there an incremental search for
denny wrote:
I really agree with this - if you can reuse it, it should be in a separate project. With that said, it's also very difficult to reuse effectively :)
Here at SO, we've tried to be very simple with three projects:
I can't speak for everyone, but I'm happy with how simple we've kept it - really speeds the builds along!
I really think it is better to split the project as well, but it all depends on the size of the project and the number of people working on it.
For larger projects, I have a projects for
I got the model from Rob Connery and his storefront application... seems to work really well.
mvc-storefront
I usually do a project for the GUI a project for the business logic a project for data access and a project for unit tests.
But sometimes it is prudent to have separation based upon services (if you are using a service oriented architecture) Such as Authentication, Sales, etc.
I guess the rule of thumb that I work off of is that if you can see it as a component that has a clear separation of concerns then a different project could be prudent. But I would think that folders versus projects could just be a preference or philosophy.
I personally feel that if reusable code is split into projects it is simpler to use other places than if it is just in folders.
Why isn't this recommended? I've found it a very useful way to manage an application with several devs working on different portions. Makes checkins much easier, mainly by virtually eliminating merges. Very rarely will two devs have to work on the same project at the same time.
By default, always just create new folder within the same project
Separating your source code into multiple projects makes only sense if you...
If you think that some portions of your source code could be reusable, still don't create it as a new project. Just wait until you will really want to reuse it in another solution and isolate it out of original project as needed. Programming is not a lego, reusing is usually very difficult and often won't happen as planned.
If you do go for creating several projects, make sure everyone who adds code to the solution is fully aware of the intention of them and do everything you can to get them to understand the dependencies between the projects. If you have ever tried to sort out the mess when someone has gone and added references that shouldn't have been there and got away with it for weeks you will understand this point