未来打样大型UI应用程序 - MFC与2008功能包,或C#和WinForms? [英] Future proofing a large UI Application - MFC with 2008 Feature pack, or C# and Winforms?

查看:188
本文介绍了未来打样大型UI应用程序 - MFC与2008功能包,或C#和WinForms?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我公司已开发在Visual C ++作为UI开发的事实标准使用MFC一个长期的产品。我们的代码库包含了遗留/古老的代码必须保持运行了很多东西。有些这段代码的比我大(最初写于70年代末),我们的团队的一些成员仍然对Visual Studio的6。

My company has developed a long standing product using MFC in Visual C++ as the defacto standard for UI development. Our codebase contains ALOT of legacy/archaic code which must be kept operational. Some of this code is older than me (originally written in the late 70s) and some members of our team are still on Visual Studio 6.

然而,结论具有谢天谢地在内部达成我们的产品相比,我们的竞争对手的样子会有些陈旧,需要做的东西。

However, a conclusion has thankfully been reached internally that our product is looking somewhat antiquated compared to our competitors', and that something needs to be done.

我目前正在对UI的新领域这是从产品的其余部分完全分开。因此,我一直在考虑尝试'新'技术堆栈作为一种移动在UI其余的漫长过程之前试验场的机会开始了。

I am currently working on a new area of the UI which is quite separate from the rest of the product. I have therefore been given the chance to try out 'new' technology stacks as a sort of proving ground before the long process of moving over the rest of the UI begins.

我一直在使用C#Windows窗体和.NET Framework一会儿在我的业余时间,享受它,但我即将造成的互操作头疼有些担心。虽然UI的这个特定分支不会需要太多的互操作与传统C ++代码库,我可以预见这成为未来的一个问题。

I have been using C# with Windows Forms and the .net framework for a while in my spare time and enjoy it, but am somewhat worried about the headaches caused by interop. While this particular branch of the UI won't require much interop with the legacy C++ codebase, I can forsee this becoming an issue in the future.

另一种方法是刚刚继续与MFC,但尝试,并采取与VS2008附带的新功能包的优势。这个我想是最简单的选择,但我担心的长寿不采取这是.NET ...

The alternative is just to continue with MFC, but try and take advantage of the new feature pack that shipped with VS2008. This I guess is the easiest option, but I worry about longevity and not taking advantage of the goodness that is .net...

所以,这我挑善良优势?我们是一个小团队,所以我的建议,将很有可能是被接受作为我们发展的一个未来发展方向 - 我想要得到它的权利。

So, which do I pick? We're a small team so my recommendation will quite probably be accepted as a future direction for our development - I want to get it right.

时MFC死了吗?是C#/的WinForms前进的道路?还有什么我完全失踪?帮助非常感谢!

Is MFC dead? Is C#/Winforms the way forward? Is there anything else I'm totally missing? Help greatly appreciated!

推荐答案

我在那有一吨遗留MFC代码的应用程序开发人员,我们都你同样的问题。我们的战略的一大驱动力是消灭尽可能多的风险和不确定性,因为我们可以,这意味着避免大重写。大家都知道,TBR失败的大部分时间。因此,我们选择了一个循序渐进的方法,使我们能够保持,不会在目前的版本中改变模​​块,书写新的功能管理,andporting那些获得增强的管理功能。

I'm a developer on an app that has a ton of legacy MFC code, and we have all of your same concerns. A big driver for our strategy was to eliminate as much risk and uncertainty as we could, which meant avoiding The Big Rewrite. As we all know, TBR fails most of the time. So we chose an incremental approach that allows us to preserve modules that won't be changing in the current release, writing new features managed, andporting features that are getting enhancements to managed.

可以做到这一点几种方式:

You can do this several ways:


  1. 在您的MFC观点主机WPF内容(见的这里

有关MFC MDI应用程序,创建一个新的WinForms框架和托管MFC MDI意见(见这里

For MFC MDI apps, create a new WinForms framework and host your MFC MDI views (see here)

在MFC对话框和视图(主机的WinForms用户控件看到的这里

Host WinForms user controls in MFC Dialogs and Views (see here)

问题与采用WPF(选项1)是,它会要求你立刻重写所有UI的,否则它会看起来很精神分裂。

The problem with adopting WPF (option 1) is that it will require you to rewrite all of your UI at once, otherwise it'll look pretty schizophrenic.

第二个方法看起来可行但很复杂的。

The second approach looks viable but very complicated.

第三种方法是我们选择之一,它一直工作得很好。它可以让你有选择地刷新你的应用领域,同时保持整体的一致性,而不是感人的事情,没有破损。

The third approach is the one we selected and it's been working very well. It allows you to selectively refresh areas of your app while maintaining overall consistency and not touching things that aren't broken.

在Visual C ++ 2008功能包看起来很有趣,我的天堂'T玩它虽然。好像它可能会与你的过时的外观的问题有所帮助。如果丝带就太不和谐了你的用户,你可以看看第三方的MFC和/或的WinForms控制供应商。

The Visual C++ 2008 Feature Pack looks interesting, I haven't played with it though. Seems like it might help with your issue of outdated look. If the "ribbon" would be too jarring for your users you could look at third-party MFC and/or WinForms control vendors.

我的整体建议是,互操作+增量变化肯定是最好彻底改变。

My overall recommendation is that interop + incremental change is definitely preferable to sweeping changes.


读你跟进后,我绝对可以确认该框架的生产率的提高大大超过投资在学习它。我们队没有人用C#在这方面的努力的开始,现在大家都喜欢它。

After reading your follow-up, I can definitely confirm that the productivity gains of the framework vastly outweigh the investment in learning it. Nobody on our team had used C# at the start of this effort and now we all prefer it.

这篇关于未来打样大型UI应用程序 - MFC与2008功能包,或C#和WinForms?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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