结构化项目&安培;在C#的WinForms较大依赖的应用 [英] Structuring projects & dependencies of large winforms applications in C#

查看:158
本文介绍了结构化项目&安培;在C#的WinForms较大依赖的应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

更新:结果
这是我的访问量最大的问题之一,但我还没有真正找到我的项目一个满意的解决方案。我在回答另一个问题读取一个想法是创建一个工具,它可以飞为您从列表中选择项目,构建解决方案。我还没有尝试,虽然。

UPDATE:
This is one of my most-visited questions, and yet I still haven't really found a satisfactory solution for my project. One idea I read in an answer to another question is to create a tool which can build solutions 'on the fly' for projects that you pick from a list. I have yet to try that though.

你如何构建一个非常大的应用程序?

How do you structure a very large application?


  • 多个短小的项目/在一个大的解决方案组件?

  • 有几个大的项目?

  • 每个项目的一个解决方案?

和你是怎么管理的,你没有一个解决方案的情况下依赖。
注:我根据经验找的建议,你在谷歌找到的答案不是(我能做到这一点我自己)

And how do you manage dependencies in the case where you don't have one solution. Note: I'm looking for advice based on experience, not answers you found on Google (I can do that myself).

我目前正在在具有向上的80 dll文件,每个都在它自己的解决方案的应用程序。管理的依赖几乎是一个全职工作。有一个定制的内部源头控制与所有的地方复制依赖的DLL附加功能。似乎是一个次优的解决方案给我,但有没有更好的办法?与80个项目的解决方案的工作将是pretty在实践粗糙,我害怕。

I'm currently working on an application which has upward of 80 dlls, each in its own solution. Managing the dependencies is almost a full time job. There is a custom in-house 'source control' with added functionality for copying dependency dlls all over the place. Seems like a sub-optimum solution to me, but is there a better way? Working on a solution with 80 projects would be pretty rough in practice, I fear.

(语境的WinForms,而不是web)

(Context: winforms, not web)

编辑:(如果你认为这是一个不同的问题,给我留个评论)

在我看来,有间相互依存关系:

It seems to me that there are interdependencies between:


  • 一个应用项目/解决方案结构

  • 文件夹/文件结构

  • 分支结构的源代码控制(如果你使用分支)

不过,我有很大的困难,这些分离出来单独考虑这些,如果这甚至有可能。

But I have great difficulty separating these out to consider them individually, if that is even possible.

我问另外一个相关的问题<一href=\"http://stackoverflow.com/questions/177338/what-do-you-do-about-references-when-unloading-a-project-in-visual-studio\">here.

推荐答案

源代码控制

我们有20个或30个项目正在建设成4或5个分立式解决方案。我们使用Subversion的SCM。

We have 20 or 30 projects being built into 4 or 5 discrete solutions. We are using Subversion for SCM.

1)我们有一棵树在含命名空间和项目名称逻辑组织的所有项目SVN。有在该建立他们所有的根的.sln,但是这不是必需的。

1) We have one tree in SVN containing all the projects organised logically by namespace and project name. There is a .sln at the root that will build them all, but that is not a requirement.

2)对于每一个实际的解决方案,我们在SVN使用SVN新干线文件夹:将所有必需的项目,使他们得到来自主树下它们的位置更新外部引用。

2) For each actual solution we have a new trunks folder in SVN with SVN:External references to all the required projects so that they get updated from their locations under the main tree.

3)在各溶液是.sln文件加上其他一些所需的文件,以及任何code是唯一到该溶液中并跨解决方案不共享。

3) In each solution is the .sln file plus a few other required files, plus any code that is unique to that solution and not shared across solutions.

有许多较小的项目,有时是一个痛苦位(例如TortoiseSVN的更新消息会导致混乱与所有这些外部链接),但确实有依赖关系不允许是圆形的巨大优势,所以我们的UI项目依赖在BO项目,但该项目BO不能引用UI(他们也不应该!)。

Having many smaller projects is a bit of a pain at times (for example the TortoiseSVN update messages get messy with all those external links) but does have the huge advantage that dependancies are not allowed to be circular, so our UI projects depend on the BO projects but the BO projects cannot reference the UI (and nor should they!).

架构
我们已经完全切换到使用 MS SCSF和CAB企业模式来管理我们的各个项目结合起来,相互作用的一个双赢表格界面的方式。我不确定,如果你有同样的问题(多个模块需要共享一个常见形式的环境空间),但如果你做那么这很可能带来一些理智和惯例如何您设计和装配的解决方案。

Architecture We have completely switched over to using MS SCSF and CAB enterprise pattern to manage the way our various projects combine and interact in a Win Forms interface. I am unsure if you have the same problems (multiple modules need to share space in a common forms environment) but if you do then this may well bring some sanity and convention to how you architect and assemble your solutions.

我提到,因为SCSF往往合并BO和UI型功能集成到同一个模块,而previously我们保持了严格的3级策略:

I mention that because SCSF tends to merge BO and UI type functions into the same module, whereas previously we maintained a strict 3 level policy:

FW - 框架code。 code,其功能涉及到软件的关注。
BO - Business Objects公司。 code,其功能涉及问题领域的关注。
UI - code涉及到UI

FW - Framework code. Code whose function relates to software concerns. BO - Business Objects. Code whose function relates to problem domain concerns. UI - Code which relates to the UI.

在那种情况下的依赖关系是严格的用户界面 - > BO - > FW

In that scenario dependancies are strictly UI -> BO -> FW

我们发现,我们甚至可以在使用SCSF生成的模块,因此,所有在世界上很好的维护结构: - )

We have found that we can maintain that structure even while using SCSF generated modules so all is good in the world :-)

这篇关于结构化项目&安培;在C#的WinForms较大依赖的应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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