views:

195

answers:

1

Hi,

I am curious what the preferred way to structure an application with an executable client program, an executable server program and a shared model in solutions and projects (using visual studio and C#). Being used to Java development I initially regarded projects as packages and defined a project for each package I designed.

This resulted in a 6 project solution (1 for the model, 1 for the server and 4 for the client) which in turn resulted in some silly dependencies causing me to reconsider if this is the best approach.

Now, I am planning to restructure the solution to 3 projects total: a client project, a sever project and a model project. Both the client and the server will be dependent on the model project (in which I will also add the shared interface between client and sever).

Is this the best way to structure such an application?

Also, what is the best way to reflect namespaces within the tree structure of Visual Studio? (just creating a similar folder structure for instance?).

Thanks in advance

A: 

A 3-project solution (client / server / model) is indeed the norm for your scenario.

Regarding namespaces: Yes, your folder structure should reflect the namespaces you are using. The default namespace can be set in the project properties, folder names are added to that namespace.

Adrian Grigore