.NET解决方案 - 许多项目对1项目 [英] .NET solution - many projects vs one project

查看:206
本文介绍了.NET解决方案 - 许多项目对1项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们现在有一个快速增长的C#codeBase的。目前,我们有大约10个项目,在平时的类别,通用/ UTIL的东西,网络层,数据库,用户界面​​组件/控制等分头行动。

We currently have a rapidly growing C# codebase. Currently we have about 10 projects, split up in the usual categories, common/util stuff, network layer, database, ui components/controls etc.

我们碰到偶尔的循环依赖,其中X项目依赖于一些在y和反之亦然。我们正在寻找可能倒塌的项目下来一个,只是使用管理结构文件夹/命名空间。我们有这当然可以组织只是用文件夹Java项目/包,所以我们还不能确定什么,如果有的话,有利于有多个项目带来的。没有我们的项目需要特殊的项目属性,除了主运行项目,我们可以保持独立(和非常薄的)。

We run into the occasional circular dependency where project x depends on something in y and vice-versa. We are looking at maybe collapsing the projects down to one and just managing using structure folders/namespaces. We have a Java project which of course organises just using folders/packages so we're not sure what, if any, benefit having multiple projects brings. None of our projects require special project properties, except the main run project, which we may kept separate (and very thin).

有没有人有,为什么一个项目比多个项目好/差的任何以往的经验,并可以建议最好的方法?同时还与循环依赖任何问题,将是有益的将是这两种方法是有用的。

Does anyone have any prior experience in why one project is better/worse than multiple projects and could suggest the best approach? And also any issues with circular dependencies would be useful in either approach would be useful.

任何输入AP preciated。

Any input appreciated.

推荐答案

在我的经验中,分离code这将创建一个可执行文件的多种的项目可有用的,如果你想

In my experience, separating code which creates a single executable in multiple projects can be useful if you want to

  • 使用不同的编程语言在不同的地区,
  • 在开发也使用其他应用程序,或库
  • 在概念上不同的多个层(即,让Visual Studio中保证有从项目中没有直接引用的的项目的应用的)。
  • use different programming languages in different parts,
  • develop libraries that are also used by other applications, or
  • conceptually separate multiple layers (i.e., let Visual Studio ensure that there are no direct references from project Lib to project App).

就个人而言,我最基础的我决定在第二个点。我认为,应用程序的一部分,可以是一个,我可能需要在其他应用更普遍的图书馆吗?把它放在一个单独的项目。否则,正如你指出,有一个单一的项目通常使开发变得更容易。

Personally, I base most of my decisions on the second point. Do I think that part of the application can be a more general library that I am likely to need in other application? Put it in a separate project. Otherwise, as you point out, having a single project usually makes development easier.

关于循环依赖:建议的方法来解决这个是放的接口的引用的东西,到第三个项目。例如,如果你有两个应用程序共享双方通过远程一些对象,你把库项目的共享对象的接口,以保证它们可用于这两个应用程序。

About the circular dependencies: The recommended way to solve this is to put interfaces of the referenced stuff into a third project. For example, if you have two applications both sharing some objects through remoting, you put interfaces of the shared objects in a library project to ensure that they are available to both applications.

不知道你的应用程序的具体设计中,这是很难给出更具体的提醒。

Without knowing the exact design of your application, it's difficult to give more concrete advise.

这篇关于.NET解决方案 - 许多项目对1项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆