C# 是否有用于 Windows 窗体、数据库驱动的应用程序开发/原型设计的框架?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/457365/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Is there any framework for Windows Forms, DB driven application development/prototyping?
提问by dolzenko
I'm writing simple database driven application, 80% of functionality is CRUD operations on about 15 tables. Coming from web development background I figured I can cover almost all of these CRUD cases with Rails scaffolding or say Django admins. So I started to look around for Rails/Django-like framework but for Windows Forms applications (ofcourse I understand that "rich client" application development significantly differs from a web development and I'm not expecting anything really similar).
我正在编写简单的数据库驱动应用程序,80% 的功能是对大约 15 个表的 CRUD 操作。来自 Web 开发背景,我想我可以用 Rails 脚手架或说 Django 管理员涵盖几乎所有这些 CRUD 案例。所以我开始四处寻找类似 Rails/Django 的框架,但寻找 Windows Forms 应用程序(当然,我明白“富客户端”应用程序开发与 Web 开发有很大不同,我并不期待任何真正相似的东西)。
I was surprised that except for a variety of ORMs (let's call it Model-layer) it seems like I'm left with little choice when it comes to View-Controller layer. Maybe I'm missing something?
我很惊讶,除了各种 ORM(我们称之为模型层)之外,对于视图控制器层,我似乎别无选择。也许我错过了什么?
PS. I evaluated Visual Studio DataSet Designer, but it seems to work only for the most simple cases, and requires additional code for any slightly nontrivial task.
附注。我评估了 Visual Studio 数据集设计器,但它似乎只适用于最简单的情况,并且需要额外的代码来完成任何稍微不平凡的任务。
(added) so far I've found:
(添加)到目前为止我发现:
- TrueView for .NET(thanks to Vijay Patel)
- NConstruct
- 适用于 .NET 的 TrueView(感谢 Vijay Patel)
- 构造
回答by dolzenko
I would start to look at the Entity Framework if you can use .net3.5
如果您可以使用 .net3.5,我将开始查看实体框架
Introducing the Entity Framework
How to: Bind Objects to Windows Form Controls (Entity Framework)
回答by Mark G
As far as I know MVC framework for Winforms don't exist. I've thought about it but I think it would just get too constricting no matter how hard you tried. The fact you're not tied to a single page in a browser just completely throws alot of standards out the window. According to your needs you can have a single MDIform that would be similar to the web and web ideologies would be applicable, or you could have an MDI form that could be filled with MDI forms and standard forms and they could need to talk to each other to make sure they're up to date, even in the background which isn't an issue in webforms.
据我所知,Winforms 的 MVC 框架不存在。我已经考虑过了,但我认为无论你多么努力,它都会变得过于狭窄。事实上,您没有被绑定到浏览器中的单个页面,这只是将很多标准抛在了脑后。根据您的需要,您可以拥有一个类似于 Web 的MDI表单,并且可以适用 Web 意识形态,或者您可以拥有一个可以填充 MDI 表单和标准表单的 MDI 表单,并且他们可能需要与每个表单进行交谈其他确保它们是最新的,即使在后台,这在 webforms 中不是问题。
At the same time threading becomes a huge issue as a half a second wait on the web is nothing while if a program freezes for even that long you have problems. There are even more approaches to threading than there are to the MDI/Form Design issue.
与此同时,线程成为一个大问题,因为在 Web 上等待半秒不算什么,而如果程序冻结了那么长时间,您就会遇到问题。线程处理的方法比 MDI/表单设计问题的方法还要多。
I've almost always lived in the WinForms world and I tend to start with a VERY generic MVC implementation and let it evolve as needed to meet the current needs. I've yet been able to apply an entire previous implementation in a greenfield project.
我几乎一直生活在 WinForms 的世界里,我倾向于从一个非常通用的 MVC 实现开始,让它根据需要发展以满足当前的需求。我还没有能够在绿地项目中应用整个以前的实现。
回答by Mark G
Shameless plug: You could try our TrueView for .NETframework.
无耻的插件:您可以试试我们的TrueView for .NET框架。
It's based on Domain Driven Design and the Naked Objects pattern. It provides an auto-generated 'explorer' style UI at run-time (no code generation step), but you're free to override forms with your own implementations.
它基于领域驱动设计和裸对象模式。它在运行时提供自动生成的“浏览器”样式 UI(无代码生成步骤),但您可以使用自己的实现自由覆盖表单。
回答by Barry Carr
You could try DevExpress eXpressAppFramework. If I've understood you correctly it should do what you're looking for. It works with Winforms and ASP.NET and also has an accompanying ORM framework. There are some videos herethat demonstrate the product. And there are forums hereif you need to ask specific questions.
你可以试试 DevExpress eXpressAppFramework。如果我正确理解你,它应该做你正在寻找的。它与 Winforms 和 ASP.NET 一起使用,并且还有一个随附的 ORM 框架。有一些视频在这里,展示的产品。如果您需要提出具体问题,这里有论坛。
回答by Dour High Arch
What is the API to the database you will be using? If it's a SOAP web service you could use the Microsoft Smart Client Factoryat CodePlex. If it's a local SQL Server database you should consider Entity Framework.
您将使用的数据库的 API 是什么?如果它是 SOAP Web 服务,您可以使用CodePlex 上的 Microsoft Smart Client Factory。如果是本地 SQL Server 数据库,则应考虑使用实体框架。
回答by L.W.C. Nirosh
Did you check Rocket Framework for Windows Form
您是否检查过 Windows Form 的 Rocket Framework
Everything is perfectly in order to support your requirement.
一切都是完美的,以支持您的要求。
- This use Entity Framework as the back-end
- Use Object Data Source to Auto-Bind Object to UI
- Use Generic to minimize the amount of code you need to write
- 这使用实体框架作为后端
- 使用对象数据源将对象自动绑定到 UI
- 使用 Generic 最大限度地减少您需要编写的代码量
Additionally, the documentation also is very well done and architecture is pretty good and stabletoo..
此外,文档也做得很好,架构也非常好和稳定。
I am using it right now and it is serving me pretty well
我现在正在使用它,它对我很好