简体   繁体   English

桌面功能通过桌面应用程序重用

[英]Web sites functionality reuse by desktop application

We are implementing some business functionality that it exposed through the asp.net web service. 我们正在实现一些通过asp.net Web服务公开的业务功能。

At the current stage user interface is required for some peace of it and we are going to implement it inside of already existing desktop application (it is MFC C++ application, but we are considering to integrate some WinForms/Wpf components). 在当前阶段,用户界面需要一些安全性,我们将在现有的桌面应用程序中实现它(它是MFC C ++应用程序,但我们正在考虑集成一些WinForms / Wpf组件)。

In the nearest future we plan to replace current desktop application with a web site version (it will be asp.net web site, or PROBABLY Silverlight application). 在不久的将来,我们计划用网站版本替换当前的桌面应用程序(它将是asp.net网站,或PROBABLY Silverlight应用程序)。 Therefore, I would like to implement UI once on the web site and just re-use it in some way from desktop application. 因此,我想在网站上实现一次UI,并以某种方式从桌面应用程序重新使用它。

Am I clear enough? 我清楚了吗?

Is there any way to do that? 有没有办法做到这一点?

For sure, I can implement web service and use it from desktop application right now and re-use it from web application when it will be required... But I hope there is a better way to do that. 当然,我可以实现Web服务并立即从桌面应用程序中使用它,并在需要时从Web应用程序中重新使用它......但我希望有更好的方法可以做到这一点。

Any thoughts are welcome! 任何想法都欢迎!

PS An option can be asp.net web page that is displayed by our desktop application. PS一个选项可以是我们的桌面应用程序显示的asp.net网页。 Desktop app will serve as a browser only (without adding any additional functionality). 桌面应用程序将仅用作浏览器(不添加任何其他功能)。

Well... you basically already have your answer. 好吧...您基本上已经有了答案。 If you're probably going to use Silverlight, if the current desktop app is build in WPF and XAML, you'll make the conversion ridiculously quickly. 如果您可能要使用Silverlight,并且当前的桌面应用程序是在WPF和XAML中构建的,那么转换将变得非常可笑。 Otherwise, you'll have to build everything like you would any other website - divs and CSS all the way for the site, and designer resx's for the desktop. 否则,您将必须像构建其他任何网站一样构建所有内容-整个网站始终使用divs和CSS,而在桌面上使用Designer resx。

Unless a customer is paying you to write and maintain redundant versions of your app, then don't do it. 除非客户付钱给您编写和维护应用程序的冗余版本,否则不要这样做。 Just write the new pieces of the web app, wrap them, and call it good. 只需编写Web应用程序的新部分,将它们包装起来,并称之为好。

If you can do so, I recommend you simply skip the integration step, as well. 如果您可以这样做,我建议您只需跳过集成步骤。 If you're going to throw the code away eventually anyhow, then it's less cost overall. 如果最终还是要丢掉代码,那么总体成本会更低。

Use whatever technology you want. 使用您想要的任何技术。 If you implement it using no client side framework, you wouldn't be bound to any particular platform. 如果您使用没有客户端框架实现它,您将不会受任何特定平台的约束。 On the other hand, if you use an existing client-side framework (such as Silverlight), and use good code design practices (like MVVM), it might be easier to unit test. 另一方面,如果您使用现有的客户端框架(例如Silverlight),并使用良好的代码设计实践(如MVVM),则单元测试可能更容易。

My idea should perfectly work with simple HTML UI implementation that will be "browsed" from desktop application through the CHtmlView control. 我的想法应该与简单的HTML UI实施完美配合,该实施将通过CHtmlView控件从桌面应用程序“浏览”。

To be honest, I didn't try to implement that (task was postponed for some time). 老实说,我没有尝试实现这一点(任务被推迟了一段时间)。

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

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