开发者

Best Visual Studio solution/project structure for client/server project with a shared model

开发者 https://www.devze.com 2023-01-05 05:51 出处:网络
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#

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 six-project solution (one for the model, one for the server and four 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 three 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 in开发者_JAVA百科terface 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?).


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消