WinForms应用程序设计 [英] Winforms application design

查看:150
本文介绍了WinForms应用程序设计的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


  1. 考虑你有一个项目和业务逻辑在其他项目的WinForm应用程序。
    UI人员的项目有参考业务逻辑的项目。

  1. Consider you have winform application in one project and business logic in other project. The project of UI staff have reference to business logic project.

在施工过程中主要的WinForm的有逻辑单元的情况下,应该是分配的GUI后面大脑和位于业务逻辑项目。提到它被保存在主WinForm的。

During construction of main winform there is allocation of instance of logic unit that should be the brain behind the gui and is located in the business logic project. reference to it is saved in the Main Winform.

假如我有一个更新的图形用户界面,我可以得到它通过调用水平的方法的返回值业务逻辑实例。

Supposing I have an updates to the gui, I can get it through return value of methods called in level of the business logic instance.

这是个糟糕的设计,你会怎么改善呢?(例子可以理解的)

Is it a bad design and how would you improve it?(Examples will be appreciated)

推荐答案

此设计将被罚款。

这听起来像你基本上要在一个单独的项目中的业务逻辑。

This sounds like you basically want your business logic in a separate project.

要使用的方法在你的WinForms项目,你只是只需要添加到它的引用。

To use the methods in you winforms project you simply only need to add a reference to it.

如果业务逻辑的项目很可能会改变,那么也许你也应该考虑实施业务逻辑的项目的接口。

If the business logic project is likely to change then perhaps you should also look into implementing an interface for the business logic project.

如果你不知道如何添加引用只是问,我可以谈谈你通过它。

If you don't know how to add the reference just ask and i can talk you through it.

这篇关于WinForms应用程序设计的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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