转换一个MVP ASP.NET应用的Silverlight 3 - 帮我选择一个架构 [英] Converting an MVP ASP.NET app to Silverlight 3 - help me choose an architecture

查看:133
本文介绍了转换一个MVP ASP.NET应用的Silverlight 3 - 帮我选择一个架构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在考虑的问一个MVP ASP.NET应用程序转换为的Silverlight。这将是我的第一个Silverlight应用程序,我挣扎,以确定如何最好地组织架构。

I've been given the ask of converting an MVP ASP.NET app to Silverlight. This will be my first Silverlight application and I'm struggling to determine how best to organise the architecture.

该应用程序是非常标准的CRUD LOB应用程序。我也将采用GIS组件,但我不认为这使得一般的架构差异(请纠正我,如果它)。我将使用亚音速作为DAL,但同样我不认为这使我的架构差异。

The app is very much a standard CRUD LOB app. I will also be using a GIS component but I dont think this makes a difference to the general architecture (please correct me if it does). I'll be using Subsonic as the DAL, but again I dont think this makes a difference to my architecture.

最初的应用是相当大的,所以如果可能的话,我想重复使用尽可能多的模型和视图成为可能。

The original application is rather large, so if possible I would like to reuse as much of the model and the view as possible.

在网络的有点混乱,以什么被认为是最佳实践为Silverlight 3的LOB应用程序的体系结构上阅读各地。微软似乎正在推动这一RIA框架 - 但它只是在preVIEW ...是生产准备好了吗?我得到微软正在推动不同架构的指导方针与Silverlight 3的IM pression,但我在努力找出究竟这些架构是!

Reading around on the web its a little confusing as to what is considered 'best practices' for the architecture of Silverlight 3 LOB apps. Microsoft seems to be pushing this RIA framework - but its only in preview...is it production ready? I get the impression that Microsoft are pushing different architectural guidelines with Silverlight 3, but I'm struggling to find out what exactly these architectures are!

有也棱镜,和卡利项目。

There is also Prism, and the Caliburn project.

Luckliy我有一个非常灵活的最后期限在这里,所以我想获得尽可能接近最佳做法,即使这意味着在开始一个学习曲线。

Luckliy I have a very flexible deadline here, so I'd like to get as close to best practices even if it means a bit of a learning curve at the beginning.

我将不胜AP preciate友好轻推在正确的方向。

I would greatly appreciate a friendly nudge in the right direction.

编辑回应答案为止


  • 该解决方案将是一个100%的全屏的Silverlight应用程序。我没有兴趣在混合Silverlight-Asp.net前端。

  • The solution will be a 100% fullscreen Silverlight app. I am not interested in a mixed Silverlight-Asp.net frontend.

考虑到这一点 - 我想要最大化codeBase类的模型和视图部分的重用,但只有当这是可能的,而不作出重大牺牲的新架构

With this in mind - I want to maximise the reuse of the model and view part of the codebase, but only if this is possible without making major sacrifices to the new architecture.

解决方案需要来自微软,或者至少得到很好的支持。

The solution needs to come from Microsoft or at least be very well supported.

如果RIA容易发布前改变,其完全退出了竞争。

If RIA is liable to change before release, its totally out of contention.

第二修改

感谢大家的出色答案。我upvoted每个人,但答案已经去到史蒂夫,因为他的回答竟是一连串的问题,我应该一直在问自己。

Thanks everyone for their excellent answers. I've upvoted everyone but the answer has to go to Steve because his answer was actually the series of questions I should have been asking myself.

曾经我有过在两个棱镜和CSLA一个很好看,我会更新线程。

I'll update the thread once I've had a good look at both Prism and CSLA.

我爱你们。

推荐答案

这么多的选择:-)您的选择可能取决于以下几个因素:

So many options :-) Your choice probably depends on several factors:


  • 您有多少要重用当前的解决方案

  • 无论你是想在全屏幕应用程序SL,或者只是用丰富的内容更换部分网站

  • 如何您当前应用程序的结构,视觉和您的ActionMethods正在返回什么

  • 时间尺度

RIA服务可能是一个不错的配合,因为这将让你至少重用模型和验证(如果你使用数据注释),但它的关闭,可能发布前改变一些方式。

RIA services might be a decent fit, as it would allow you to at least reuse your model and validation (if you're using data annotations) but it's some way off and likely to change before release.

另一种选择是一个上爬起来Silverlight应用程序,为此,我建议在 PRISM考虑看看和MVVM以构建它(如果只保持最初的有效载荷下来!)。你也许可以重新使用你的模型,并有用于在Silverlight数据注解的支持,但你不会的的关再造一个新的应用程序。

The other option is a ground up Silverlight app, for which I'd recommend taking a look at PRISM and MVVM for structuring it (if only to keep the initial payload down!). You could probably reuse your model, and there is support for data annotations in Silverlight, but you wouldn't be far off recreating a new application.

第三个选项,一个你可以爱或恨,是构建丰富的SL功能孤岛为您的网站的区域。你可以使用你现有的MVC应用程序,并可能有ActionMethods返回JSON(或者,如果你preFER XML),您的SL领域可能消耗和渲染。你必须体面code再利用,你可以提高隔离网站的区域。

The third option, and one that you may love or hate, would be to build "islands" of rich functionality in SL for areas of your site. You could use your existing MVC app and potentially have ActionMethods return JSON (or XML if you'd prefer) which your SL areas could consume and render. You'd have decent code re-use and you could enhance areas of the site in isolation.

这是开放式的答案,一个开放式的问题: - )

An open ended answer to an open ended question :-)

修改:由你的反应来看,如果是我,我会创造一个PRISM应用程序。如果它是目前一个web应用程序应该坐相当不错的区域模型(虽然你不会真正重用任何视图code)和动态XAP负荷将与您最初的有效载荷帮助,如果你想有一个单一的全屏幕应用程序。如果它是一个基于CRUD的应用程序,那么你可能想看看在 XAML电源玩具赶紧把数据表单在一起。

EDIT: Judging by your responses, if it were me, I'd be creating a PRISM app. If it's currently a web app it should "sit" quite well with the region model (although you wouldn't be actually reusing any view code), and the dynamic XAP loading will help with your initial payload if you want a single full screen app. If it's a CRUD based app then you might want to take a look at the XAML Power Toys to quickly put data forms together.

Datawise您既可以重用你的模型,并通过WCF或ADO.Net数据服务揭露它,等待RIA服务稳定(具体取决于您的时间尺度)或仍然使用MVC的操作方法,但是从他们返回JSON的SL应用消耗。

Datawise you could either reuse your model and expose it via WCF or ADO.Net Data Services, wait for RIA services to stabilise (depending on your timescales) or still use the MVC action methods but return JSON from them for the SL app to consume.

这篇关于转换一个MVP ASP.NET应用的Silverlight 3 - 帮我选择一个架构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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