为什么不使用SOA方式,要提出这个新的东东OData
2014-03-20 16:01
211 查看
For anybody familiar with service-oriented architecture (SOA), OData raises an obvious question: Why not use a SOA approach to exposing data? Why invent something new with OData?
As described earlier, one clear advantage of OData is its commonality: Rather than having each application define its own unique set of services, they can all use the common data model and protocol defined by OData.
就像前面表述的,Odata一个明显的优势就是通用性:不是每一个应用程序都定义它自己的一套服务,而是他们可以使用OData定义的相同的数据模式和协议。
This makes it easier to mix and match clients and data sources, and it also allows using common libraries to create both.
But there's also another reason why OData can be better for exposing data than a traditional SOA approach. Suppose an application needs to expose data about customers and orders to various clients. With the SOA approach, the application's creators would
define a set of custom operations (using either REST or SOAP) that clients could call. They might, for example, create a GetCustomer operation that returned data about one or more customers. If the application's first client wanted the ability to retrieve
customers by customer number, this operation might have a parameter that allowed making exactly this kind of request.
但是也有另一个原因为什么OData可以比传统SOA方式更好的暴露数据。 假设一个应用程序需要暴露客户和订单的信息给各种各样的客户端。若用SOA方式,这个应用程序的创建者将会定义一套自定义个操作,以供客户端调用。 举个例子,他们也许创建一个GetCustomer的操作,返回关于一个或者多个客户的数据。 如果它的第一个客户端想要数据通过客户的。。
Now suppose another client wants to access this application's data through the same interface. This client needs to retrieve customer data by geographic area, however, rather than by customer number. To allow this, the creator of the application's interface
likely adds a new operation, perhaps called GetCustomerByGeo. When yet another client appears, it might well want to retrieve customer data in some other way, requiring still more changes to the interface.
It's common to see this kind of evolution in SOA interfaces today, and it's not a pretty thing. The problem grows out of a fundamental limitation, however, which is that services expose only specific views into an application's data. It's as if the data
is behind a curtain, with each service punching a hole in that curtain. The creator of this interface is forced to guess how the application's clients will want to access the data, deciding in advance what holes to cut in the curtain.
Contrast this with how OData works. Rather than exposing application-defined services, it allows access to an entire application-defined data model. Clients are free to query this model in any way they find useful. The application's creator still has control
over what's exposed, of course, and designing the data model likely requires making some predictions about what clients will want. Still, exposing a data model pulls back the curtain on an application's data, giving clients more flexibility in how they access
it.
Not every problem that relies on SOA today should use OData, of course. If an application exposes a functionality- oriented set of services rather than services targeting data access, for instance, OData probably isn't a good choice. But for applications
that wish to expose data in a broader, more consistent way to diverse clients, using OData can be an attractive option.
理解:就是SOA一个需求,你要给定义一个API,
而OData是把整个数据模型都暴露出来了。
A Perspective: OData in a SOA World
http://msdn.microsoft.com/en-us/data/hh237663.aspxFor anybody familiar with service-oriented architecture (SOA), OData raises an obvious question: Why not use a SOA approach to exposing data? Why invent something new with OData?
As described earlier, one clear advantage of OData is its commonality: Rather than having each application define its own unique set of services, they can all use the common data model and protocol defined by OData.
就像前面表述的,Odata一个明显的优势就是通用性:不是每一个应用程序都定义它自己的一套服务,而是他们可以使用OData定义的相同的数据模式和协议。
This makes it easier to mix and match clients and data sources, and it also allows using common libraries to create both.
But there's also another reason why OData can be better for exposing data than a traditional SOA approach. Suppose an application needs to expose data about customers and orders to various clients. With the SOA approach, the application's creators would
define a set of custom operations (using either REST or SOAP) that clients could call. They might, for example, create a GetCustomer operation that returned data about one or more customers. If the application's first client wanted the ability to retrieve
customers by customer number, this operation might have a parameter that allowed making exactly this kind of request.
但是也有另一个原因为什么OData可以比传统SOA方式更好的暴露数据。 假设一个应用程序需要暴露客户和订单的信息给各种各样的客户端。若用SOA方式,这个应用程序的创建者将会定义一套自定义个操作,以供客户端调用。 举个例子,他们也许创建一个GetCustomer的操作,返回关于一个或者多个客户的数据。 如果它的第一个客户端想要数据通过客户的。。
Now suppose another client wants to access this application's data through the same interface. This client needs to retrieve customer data by geographic area, however, rather than by customer number. To allow this, the creator of the application's interface
likely adds a new operation, perhaps called GetCustomerByGeo. When yet another client appears, it might well want to retrieve customer data in some other way, requiring still more changes to the interface.
It's common to see this kind of evolution in SOA interfaces today, and it's not a pretty thing. The problem grows out of a fundamental limitation, however, which is that services expose only specific views into an application's data. It's as if the data
is behind a curtain, with each service punching a hole in that curtain. The creator of this interface is forced to guess how the application's clients will want to access the data, deciding in advance what holes to cut in the curtain.
Contrast this with how OData works. Rather than exposing application-defined services, it allows access to an entire application-defined data model. Clients are free to query this model in any way they find useful. The application's creator still has control
over what's exposed, of course, and designing the data model likely requires making some predictions about what clients will want. Still, exposing a data model pulls back the curtain on an application's data, giving clients more flexibility in how they access
it.
Not every problem that relies on SOA today should use OData, of course. If an application exposes a functionality- oriented set of services rather than services targeting data access, for instance, OData probably isn't a good choice. But for applications
that wish to expose data in a broader, more consistent way to diverse clients, using OData can be an attractive option.
理解:就是SOA一个需求,你要给定义一个API,
而OData是把整个数据模型都暴露出来了。
相关文章推荐
- 使用uri的方式打开应用、为什么要设置Action
- 10033---Redis 为什么使用单进程单线程方式也这么快
- 网络传输中,对Json组织方式的数据的解析以及使用这个方法,模拟从服务器端下载数据
- 为什么在中断向量表中不直接LDR PC ,"异常地址"。而是使用一个标号,然有再在后面使用 DCD定义这个标号
- 游戏中为什么使用脚本游戏为什么会有脚本这个东西
- 如何使用ASP.NET Web API OData在Oracle中使用Entity Framework 6.x Code-First方式开发 OData V4 Service
- 如题,既然直接对一个实例发送方法名就可以调用这个方法,那为什么还要使用performSelector:去调呢?两者u有啥区别
- 为什么在定义hashcode时要使用31这个数呢?
- 数据库同步为什么不建议使用dblink方式
- 为什么会有jsessionid,这个东东有什么用呢?
- SOA常见的使用方式
- 为什么在定义hashcode时要使用31这个数呢?
- 使用堆的方式弄出来一个数组为什么一定要delete[]
- 使用手动的方式来新建一个账号,并且指定这个账号属于某个用户组
- 为什么在Cassandra版本0.6.1中不适合使用Binary Memtable的方式导入大量的数据。
- 为什么在定义hashcode时要使用31这个数呢?
- 苹果不允许 iOS 应用内置购买(IAP)使用第三方支付方式,那么跨平台的支付怎么解决这个问题?
- 为什么在定义hashcode时要使用31这个数呢?
- 转:为什么在定义hashcode时要使用31这个数呢?
- 为什么我使用source /etc/profile这个命令之后,新的环境变量只能在一个终端里面有效? 为什么我使用source /etc/profile这个命令之后,新的环境变量只能在一个终端里