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操作也不容易。

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

你可能感兴趣的:(架构理论,rest,soap,soa,notifications,security,delete)