简体   繁体   English

在小规模开发中使用WPF框架/模块

[英]Using WPF Frameworks / Modules in Small Scale Development

I have read quite a few posts on SO and around the web of the benefits and features of various WPF Frameworks (Caliburn, Prism) and Module Frameworks (MEF, Unity) and combining them. 我已经在SO和网络上阅读了很多关于各种WPF框架(Caliburn,Prism)和模块框架(MEF,Unity)的优点和功能并将它们组合在一起的文章。

In theory, I love the ideas behind them. 从理论上讲,我喜欢背后的想法。 And I know once I get a grasp on those systems, that it may actually increase development speed - but the upfront cost of learning tools and frameworks with that level of complexity seems high. 而且我知道一旦掌握了这些系统,它实际上可能会提高开发速度-但是具有这种复杂性的学习工具和框架的前期成本似乎很高。

Project Background: 项目背景:
I am taking a 10-year old series of Access databases (with an enormous amount of bad macro code) and redesigning the database. 我正在使用10年的Access数据库系列(带有大量错误的宏代码),然后重新设计数据库。 On top of that, I want to come up with the best way to display and present that information. 最重要的是,我想提出一种显示和呈现该信息的最佳方法。 Using Access (2007) is an option, but not one I would like to use. 使用Access(2007)是一个选项,但我不想使用。

The company I am working for is a small to medium size business and the app will have about 40-80 concurrent users during the work day. 我正在工作的公司是中小型企业,该应用程序在工作期间将有大约40-80个并发用户。 This is the reason I would like to avoid Access. 这就是我要避免访问的原因。

I am currently using the Model-First feature of Entity Framework 4 (SQL Server 2008 R2) and .NET 4 (C#/WPF). 我目前正在使用Entity Framework 4(SQL Server 2008 R2)和.NET 4(C#/ WPF)的“模型优先”功能。

Dilemma: 困境:
The high level of design for the new database is permission based (a role is simply a collection of permissions) and I want the UI to show the information/edit buttons/etc based on these permissions. 新数据库的高级设计是基于权限的(角色只是权限的集合),我希望UI根据这些权限显示信息/编辑按钮/等。 If I go for a standard approach, the code would be littered with if/else statements. 如果我采用标准方法,则代码中会有if / else语句。 However, if I go with a large framework - I feel it is overkill for what is basically a database access layer - especially given the high upfront learning curve. 但是,如果我使用大型框架-我觉得对于基本的数据库访问层来说这是过大的了-特别是考虑到较高的前期学习曲线。 Not to mention I'm not 100% sure these frameworks would help me in the way I beleive they will. 更不用说我不是100%肯定这些框架会以我相信的方式帮助我。

The Question: 问题:
I am looking for some discussion as to whether these frameworks are worth the learning curve in a small-scale, "database layer" type applications. 我正在寻找有关这些框架是否值得在小型“数据库层”类型的应用程序中学习的讨论。

In addition, if they are considered overkill, are there any frameworks that COULD help with this type of system? 另外,如果认为它们过大,那么是否有任何框架可以帮助此类系统? I have considered transitioning the UI to the web which seems perfect (and is more my expertise). 我已经考虑过将UI转换为看起来很完美的Web(这也是我的专长)。

Thanks for your time. 谢谢你的时间。

From the sounds of it, this seems like a perfect candidate for WCF RIA Services . 从声音上看,这似乎是WCF RIA Services的理想选择。 You could then use your choice of presentation (Silverlight or ASP.NET, currently) for the front end. 然后,您可以将选择的演示文稿(当前为Silverlight或ASP.NET)用于前端。 Depending on the specific scenario, you could mix and match the presentation. 根据具体情况,您可以混合并匹配演示文稿。

Given the conventional approach of Caliburn and your security needs, I think they would be a good fit. 考虑到Caliburn的常规方法以及您的安全需求,我认为它们非常合适。 With Caliburn you are able to wire up control automagically based on either a specified convention or one that is baked in. Show you could have a convention for Button where its name contains a suffix that relates to the Role that is allowed to use the action. 使用Caliburn,您可以基于指定的约定或引入的约定自动连接控件。显示您可能具有Button的约定,其名称包含与允许使用该操作的角色相关的后缀。 Using a base ViewModel that exposes the Users role, you could have the Convention Enable/Disable the Button based on the user Role. 使用公开用户角色的基本ViewModel,您可以基于用户角色使Convention启用/禁用Button。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM