REST 和 SOA

REST和SOA的差别到底如何,到底何时使用REST,何时使用SOA

from Dr. Dobb's | SOA and Future Trends

  • The REST architectural style doesn't account for all that is required in a full-fledged SOA (for example, no specific definition around horizontal services such as security). The central argument between REST and SOAP given can be characterized by pointing out additional requirements that only a SOAP framework can provide. Rather than thinking of REST versus SOAP, one should consider the value the each brings to the table when architecting a SOA.
  • REST-style interfaces with a diversity of nouns and scarcity of operations (Create, Read, Update and Delete) are often the best choice for simple services. SOAP-based interfaces should be used when the message-exchange pattern requires additional features such as reliable messaging, message-level security, more robust descriptions (WSDL), and the possibility of patterns like one-way notifications or publish/subscribe
  • 就是说REST是简单的利用HTTP的put,get,delete,数据都在http header里面,彻底的一个HTTP,是从web引申出来的一个架构模式,它将所有的操作都抽象化为对web资源的CRUD操作,由于http,所以是无状态的,而且相对简单。但是如果稍微复杂一点,用它就不太合适了,比如安全,交易等等,而且复杂的应用一定要抽取成CRUD操作也不容易。

    当然,具体在项目中,除了以上因素以外,使用哪一种方法还取决于架构师以及项目组对两种方式的熟悉程度。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值