为什么 RIA 服务被称为黑魔法?

发布于 2024-10-26 13:25:03 字数 139 浏览 1 评论 0原文

为什么人们称 RIA 服务为黑魔法?他们指的是哪种黑魔法?另外,我发现大多数人即使在 Silverlight 世界中也不使用 RIA。为什么会这样呢?即使在 stackoverflow 上,询问和回答 RIA 服务问题的人所占的百分比也非常非常低。为什么会这样呢?

Why do people call RIA services a black magic? What kind of black magic do they refer to ? Also, i have seen most people do not use RIA even though they are in Silverlight world. Why is it so? Even on stackoverflow, the % of people asking as well as answering to RIA services question is very very low. Why is it so?

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

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

发布评论

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

评论(3

世俗缘 2024-11-02 13:25:03

WCF RIA 服务提供以下好处:

  • 制作支持 IQueryable 和 IEnumerable 的 WCF RIA 服务; WCF RIA 服务创建客户端代理,允许您仅通过网络从客户端发送表达式树,以便仅取回您需要的数据。例如:您可以在 ria 服务中调用名为 GetProducts() 的方法,还可以添加 LINQ lambda,例如 GetProducts().Where( d => d.Quantity > 50 ),并且仅通过线路发送表达式到服务器。服务器进行过滤并仅将匹配项作为强类型对象返回。
  • 动态生成 OData、REST/JSON 和 SOAP 端点,在 web.Config 中每个端点只需要一行。
  • 能够自动将中间层创建的业务规则传递到客户端层
  • 允许您有效地将验证从中间层传递到用户
  • 通过简单的数据注释验证器装饰允许属性、参数、方法、对象、集合和变更集级别的业务规则

有一些不足:

  • 仍然不支持 WS-*(将在 5 中)对于 RPC
  • OData 提供程序不可查询

WCF RIA Services provides the following benefits:

  • Makes a WCF RIA service that supports IQueryable and IEnumerable; WCF RIA Services creates client-side proxy which allows you to send only expression trees over the wire from the client in order to get back just the data you need. For example: you can call a method in your ria service called GetProducts() but also add a LINQ lambda such as GetProducts().Where( d => d.Quantity > 50 ) and only the expression is sent over the wire to the server. The server does the filtering and returns just the matches as strongly typed objects.
  • Dynamic generation of OData, REST/JSON, and SOAP endpoints with little more than a single line per endpoint in your web.Config.
  • Ability to automatically flow business rules created at the middle tier into the client tier
  • Allows you to efficiently flow validations from the middle tier to the user
  • Allows property, parameter, method, object, collection, and changeset level business rules through simple data annotation validator decoration

There are some deficiencies:

  • Still does not support WS-* (will in 5) for RPC
  • OData provider is not queryable
苹果你个爱泡泡 2024-11-02 13:25:03

嗯,我还没有听说有人将 WCF RIA 服务称为黑魔法。

我相信使用它的人很少(与在 Silverlight 中编写东西的人数相比),因为它更年轻。人们可能已经使用经典的 WCF 服务开发 Silverlight 应用程序一段时间了(3.0 版于 2009 年 7 月发布)。

WCR RIA 服务仍然是新的(1.0 版本于 2010 年 5 月发布,最终 SP1 于 2010 年 12 月发布),我们都知道规则“永远不要更改正在运行的系统”,所以如果有人已经拥有一个正在运行的 WCF Web 服务,为什么要更改它?就我而言,我们前段时间尝试过 Silverlight 和 WCF,并决定等待。当 RIA Services 推出时,我们认为这很棒,并开始开发我们主应用程序的 Silverlight 版本。在新项目中使用 RIA 服务比​​在现有项目中更改 Web 服务访问要容易得多。

除此之外,应该指出的是,Silverlight 并不限于使用 Web 服务进行数据库访问的业务应用程序。因此,可能有相当多的 Silverlight 开发人员不需要任何类型的 Web 服务。

另一个原因可能是,对于需要数据库的 Web 应用程序,其他技术,如 ASP.NET、ASP.NET MVC,甚至 PHP 或 JSP(可能还有其他我可能从未听说过的技术)已经存在相当长一段时间了。尽管业务应用程序也应该看起来不错,但拥有各种精美的图形和动画等通常不是首要要求。

最后,为什么在 SO 上询问有关 RIA 服务的问题如此之少?嗯,他们确实有自己的自己的论坛,看起来相当活跃。 (我在寻找答案时将其用作资源,但不在那里发布。)

Well, I have not yet heard of people referring to WCF RIA Services as black magic.

I believe there is a small number of people using it (compared to the number of people writing stuff in Silverlight), because it is younger. People may have been developing their Silverlight applications for some time now (version 3.0 came out in July 2009) using classic WCF Services.

WCR RIA Services is still new (version 1.0 came out in May 2010, the final SP1 in December 2010) and we all know the rule, "Never change a running system", so if someone already has a working WCF webservice, why change it? In my case, we experimented with Silverlight and WCF some time ago and decided to wait. When RIA Services came out we thought that was great and started working on a Silverlight version of our main application. It is much easier using RIA Services in a new project than chaning your webservice access in an existing one.

In addition to that it should be noted that Silverlight is not limited to business applications with database access using a webservice. Therefore there may be quite a few Silverlight developers who do not need any kind of webservice.

Another reason might be the fact that for web applications requiring a database other technologies like ASP.NET, ASP.NET MVC, even PHP or JSP (and possibly others I may not even have heard of) have existed for quite a while. And although business applications ought to look nice, too, it usually is not the top requirement to have all kinds of fancy graphics and animations, etc.

Finally, why are so few questions regarding RIA Services asked on SO? Well, they do have their own forum which seems to be quite active. (I use it as a resource when looking for answers but don't post there.)

甜嗑 2024-11-02 13:25:03

关于您问题的“黑魔法”部分,我认为这是向 的持续转变约定优于配置。与普通的 WCF 相比,您最终只需编写很少的代码来构建客户端-服务器关系。此外,WCF RIA 工具会生成大量代码来实现此目的。

有关约定优于配置的更多信息,特别是 WCF RIA< /a> 以及维基百科

Regarding the "black magic" part of your question, I believe it is the ongoing shift to convention over configuration. Compared to vanilla WCF, you end up writing very little code to build the client-server relationship. Also, the WCF RIA tooling does a substantial amount of code generation to achieve this.

More on convention over configuration on specifically with WCF RIA and generally at Wikipedia.

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