Silverlight / Prism / RIA:如何创建最优的基础设施?

发布于 2024-10-11 02:39:46 字数 1010 浏览 3 评论 0原文

这些天以来,我一直在阅读和研究,并且仍在努力如何创建完美的基础设施。由于没有这样的 Prism 4.0 模板,我想出了一个策略,但我需要确保这是正确的策略,并且我将感谢经验丰富的 PRISM/RIA 开发人员的建议。

我使用 PRISM 4.0、RIA Services 1.0 Sp1 Beta、Silverlight 4.0、Entity Framework 4.0

1) 客户端

我首先创建了一个“Silverlight 业务应用程序”,它创建了一个 Web。主机和已实施 RIA 授权的 Silverlight 客户端应用程序。最初创建的 Silverlight 客户端应用程序应用作 Shell 项目。

2) 基础设施项目(通用)

该项目将包含一些通用的 Prism MEF 属性,或许还有 RIA 自动生成的实体模型以及服务接口。这个想法是创建一个简单的 Silverlight 类库,在项目的属性下,我将选择下拉列表“WCF Ria Services Link”以指向包含 Ria 服务的 host.Web 项目。然后在重建之后,我能够看到类库中的实体模型,然后可以在 prism 模块之间共享这些实体模型以提供其 ViewModel 等。

3) 服务层

我应该创建 EF4 模型吗在 Web.host 项目上并在其中添加域服务?然后我会从域服务中提取一个接口并将该接口放入基础设施(公共)项目中。因此,Web.Host 需要引用基础设施(公共)项目才能访问该接口。在客户端,MEF 可以使用该接口来检索或模拟服务。但是,我担心引用一个公共项目的服务,该项目还包含客户端生成的实体。

4)授权

还有一点关心授权问题,我要把所有东西都留在Shell项目上吗?或者我是否必须将任何内容移至基础设施(公共)项目才能共享?

由于这是我第一次使用 PRISM 进行设计,我可能误解或忘记了一些方面。请随时改进我的建议。

非常感谢您的帮助

Kave

Since days I am reading and researching and still struggling how to create the perfect infrastructure. Since there are no Prism 4.0 templates as such, I came up with a strategy, but I need to be sure this is the right strategy and I would appreciate an advice from experienced PRISM/RIA developers.

I use PRISM 4.0, RIA Services 1.0 Sp1 Beta, Silverlight 4.0, Entity Framework 4.0

1) Client side

I created first a "Silverlight Business Application", which creates a Web.host and a Silverlight client application with implemented RIA authorization. The initially created Silverlight client application shall be used as the Shell project.

2) Infrastructure project (Common)

This project would contain some common Prism MEF attributes and perhaps the entity models that are auto generated by RIA as well as the Service Interface. The idea is to create a simple Silverlight Class Library, and under Properties of the project, I would select for the dropdown ‘WCF Ria Services Link ’ to point to the host.Web project that contains the Ria Services. Then after the rebuilding, I am able to see the entity models within the Class Library and these could then be shared between the prism modules to feed their ViewModels etc.

3) Service layer

Should I create the EF4 Model on the Web.host project and add the Domain Service in there? Then I would extract an interface from the Domain Service and put the interface into the Infrastructure (Common) project. The Web.Host therefore needs to reference the Infrastructure (common) project to get access to the interface. On the client side the interface may be used by MEF to retrieve or mock the service . However I am concerned about the service referencing a common project that contains also the client-side generated entities.

4) Authorization

Also a bit concerned about the authorization, shall I leave everything on the Shell project? Or do I have to move anything to the Infrastructure (common) project to share it?

Since this is my first time designing with PRISM, I might have misunderstood or forgotten some aspects. Please feel free to improve my suggestions.

Your help is highly appreciated

Kave

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

魔法唧唧 2024-10-18 02:39:46

经过两周的深入研究,这个博客无法将其更好地组合在一起:
http://blogs .msdn.com/b/dphill/archive/2009/08/17/prism-and-net-ria-services.aspx

After two weeks of intense research, this blog couldn't put it better together:
http://blogs.msdn.com/b/dphill/archive/2009/08/17/prism-and-net-ria-services.aspx

痴情换悲伤 2024-10-18 02:39:46

Prism 有很好的快速入门模板,我在博客 http://blogs.msdn.com/ 中找到了它b/dphill 所以它看起来很不错,我用它还创建了 RIA 服务库,所以现在一切都分开了:

1)WEb 项目
2) Ria 网页服务
3) 将 RiaService 客户端代码生成为单独且共享的程序集,并由模块使用。就是这样。

There're nice Quick Start templates for Prism, I found it at blog http://blogs.msdn.com/b/dphill so it looks quite nice, I used it also created RIA Service library so everything now is separated:

1) WEb project
2) Ria Service on web
3) generated RiaService client code as separate and shared assembly and it is used by modules. that's it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文