用于多平台开发的 WCF OData? [英] WCF OData for multiplatform development?

查看:21
本文介绍了用于多平台开发的 WCF OData?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此问题中的 OP 询问使用 WCF/OData 作为内部数据访问层.

The OP in this question asks about using an WCF/OData as an internal data access layer.

参数直接使用 WCF/OData 作为访问层而不是 EF/L2S/nHibernate

响亮的答复似乎是不要这样做.我与 OP 处于类似的位置,但在原始问题中没有提出一个问题.我正在尝试为许多不同的平台(本地)进行开发,但希望尽可能多地保留数据和业务逻辑服务器端.所以我将拥有 iOS/Android/Web (MVC)/桌面应用程序.目前,我有一个带有 ORM 数据访问层 (LLBLGen Pro) 的 WinForms 应用程序.

The resounding reply seems to be don't do it. I'm in similar position to the OP, but have a concern not raised in the original question. I'm trying to develop (natively) for a lot of different platforms but want to keep as much of the data and business logic server side as possible. So I'll have iOS/Android/Web (MVC)/Desktop applications. Currently, I have a single WinForms applications with an ORM data access layer (LLBLGen Pro).

我设想将我的大部分业务/数据访问逻辑(可能仍然使用 LLBLGen 或其他 ORM)移到 WCF/OData 接口后面.然后让我在不同平台上的所有不同客户端非常瘦(基本上是 UI 和 WCF 调用).

I'm envisioning moving most of my business / data access logic (possibly still with LLBLGen or other ORM) behind a WCF / OData interface. Then making all my different clients on the different platforms very thin (basically UI and WCF calls).

这也是过度设计吗?我错过了一个更简单的解决方案吗?

Is this also overengineered? Am I missing a simpler solution?

推荐答案

我看不出你的架构有任何问题,或者认为它过度设计,因为 OData 是一个标准协议,你的概念也符合 DRY 原则.

I cannot see any problem in your architecture or consider it overengeenered as a OData is a standard protocol and your concept conforms the DRY principle as well.

我改变问题:为什么要在每个客户端中实现相同的业务逻辑以引入更多可能的错误并失去在一个单一和集中的地方修复错误的可能性.您的想法使您能够仅实现一次安全层.

I change the question: Why would you implement the same business logic in each client to introduce more possible bugs and loose the possibility to fix the errors at one single and centralized place. Your idea makes you able to implement the security layer only once.

OData 是一个跨平台标准,您可以为每个开发平台找到一个 OData 库(MSDNOData.orgJavaScript 的 JayData).此外,您可以使用 OData FunctionImports/Service 方法和实体级方法,这将简化您的查询.

OData is a cross-platform standard and you can find a OData libraries for each development platform (MSDN, OData.org, JayData for JavaScript). Furthermore, you can use OData FunctionImports/Service methods and entity-level methods, which will simplify your queries.

这篇关于用于多平台开发的 WCF OData?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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