views:

116

answers:

6

How many projects in a single solution is acceptable? And for those apps that have large project numbers do you put the other compiled dlls in some common folder to be able to run the app?

+2  A: 

There is no right or wrong answer to this. Some developers like to create multiple projects within the main project. Others like to compile to an assembly (the dll) and reference back. It depends on your team and workplace.

JonH
A: 

As long as each project is a valid, separate functionality, and all the projects are closely coupled (as far as purpose goes), then it isn't a problem.

What I do, is I have a "Libraries" project where I put all my external DLLs, then reference them directly there.

Erich
+1  A: 

Well, 42, of course!

luvieere
A: 

I think this is something that depends on the size and type of your projects . but from my own experience when my number of projects is more than 5 the build process will take long . so I try to keep projects that I do not need to change frequently in another solution in order to make the build process faster .

Asha
A: 

I agree with the answers so far. One additional critirion is the speed of rebuilding the solution...

Nestor
+1  A: 

Since in Visual Studio a project compiles to an assembly, the question you should ask yourself is "how many assemblies should I have?"

If there's no reason for the assemblies to be used separately, there should be no reason to have them split in several projects. If you have several assemblies to enforce layering, that's what namespaces are for.

In an ideal setup, you should have one project (= one assembly) for each different host in your application, and one for your non-host specific logic.

YMMV though, you may want to split projects according to who is working on the different parts, but really, try to limit the number of projects in your solution (as I'm writing this, I'm struggling with a 70+ projects solution, so I'm talking from the abysses of my personal experience).

A interesting discussion on logical/physical layering of applications can be found on Patrick Smacchia's blog (for instance http://codebetter.com/blogs/patricksmacchia/archive/2008/02/10/layering-the-level-metric-and-the-discourse-of-method.aspx )

Yann Schwartz
Too many (small) assemblies makes it difficult to use `internal` (at least w/o resorting to `[InternalsVisibleTo]`).
Dan

related questions