简体   繁体   English

SOA的功能和表示形式到底是什么?

[英]What exactly is functionality and presentation of SOA?

Looking for answers on what exactly REST is, I came across a post on SOA on stack overflow: 在寻找关于什么是REST的答案时,我在堆栈溢出中遇到了有关SOA的帖子:

"magine you are developing a web-application and you decide to decouple the functionality from the presentation of the application, because it affords greater freedom. You create an API and let others implement their own front-ends over it as well. What you just did here is implement an SOA methodology, ie using web-services" “想象一下您正在开发一个Web应用程序,并且您决定将功能与应用程序的表示分离开来,因为它提供了更大的自由度。您创建了一个API,并让其他人也可以在其上实现自己的前端。这里所做的是实现SOA方法,即使用Web服务”

As far as I understand, this is saying that SOA is an umbrella term for designing software in such a way that functionality and presentation are separated (is that not MVC?). 据我了解,这就是说SOA是设计软件的总称,其方式是将功能和表示分开(不是MVC吗?)。 And that REST is a means of doing that. REST是做到这一点的一种手段。

What is the functionality, and what is the presentation is this case? 功能是什么,这种情况的表现形式是什么?

I understand REST as an architecture for designing server side code that creates URI links as included in the HTML on a browser, and that processes stateless server requests. 我将REST理解为用于设计服务器端代码的体系结构,该代码可创建浏览器HTML中包含的URI链接,并处理无状态服务器请求。 Is this correct? 这个对吗? and if so, what is the alternative to this? 如果是这样,还有什么替代方案?

What exactly would a server request that isn't stateless be? 不是无状态的服务器请求到底是什么?

Here is the original question: JSON, REST, SOAP, WSDL, and SOA: How do they all link together 这是原始问题: JSON,REST,SOAP,WSDL和SOA:它们如何链接在一起

I don't know if my question makes sense, I'm quite confused. 我不知道我的问题是否有意义,我很困惑。

As far as I understand, this is saying that SOA is an umbrella term for designing software in such a way that functionality and presentation are separated 据我了解,这就是说SOA是设计软件的总称,其功能和表示形式是分开的

Yes, that is the goal. 是的,这就是目标。 But SOA implies a particular approach to that goal where the different parts of a system are actually separate programs, communicating over some API. 但是SOA意味着实现该目标的一种特殊方法,其中系统的不同部分实际上是独立的程序,通过一些API进行通信。 Each of those parts might be in different programming languages, or on physically separate hosts. 这些部分中的每个部分可能使用不同的编程语言,或位于物理上独立的主机上。

(is that not MVC?) (不是MVC吗?)

MVC is a way of structuring a single program by breaking up its code into reusable units. MVC是一种通过将其代码分解为可重用单元来构造单个程序的方法。 But a Model object is only useful if it can be passed around the application, you couldn't run it as a separate program. 但是Model对象仅在可以在应用程序中传递时才有用,而您不能将其作为单独的程序运行。 You could, however, write an MVC program that was one of the components in an SOA system - eg consuming an API in a particular way and turning its results into model objects, then passing them to an HTML view. 但是,您可以编写一个MVC程序,该程序是SOA系统中的组件之一,例如,以特定方式使用API​​,并将其结果转换为模型对象,然后将其传递给HTML视图。

I understand REST as an architecture for designing server side code that creates URI links as included in the HTML on a browser, and that processes stateless server requests. 我将REST理解为用于设计服务器端代码的体系结构,该代码可创建浏览器HTML中包含的URI链接,并处理无状态服务器请求。 Is this correct? 这个对吗? and if so, what is the alternative to this? 如果是这样,还有什么替代方案?

Not quite. 不完全的。 REST has nothing to do with HTML, only HTTP: rather than using a wrapper like an XML document which says "I would like you to do action X, here is the input Y" (which is roughly what SOAP does), REST uses the URL and the type of HTTP request (GET, POST, PUT, DELETE) to describe what's needed. REST与HTML无关,仅与HTTP无关:与其使用像XML文档这样的包装,它说“我想做X动作,这里是输入Y”(大致就是SOAP所做的事情),REST却使用了URL和用于描述所需内容的HTTP请求类型(GET,POST,PUT,DELETE)。 It comes with a philosophy that the object of an action (eg /user/42) is more central than the specific verb (eg ResetPassword) 它带有一种哲学,即动作的对象 (例如/ user / 42)比特定的动词 (例如ResetPassword)更重要

What exactly would a server request that isn't stateless be? 不是无状态的服务器请求到底是什么?

HTTP itself is a stateless protocol, but that doesn't mean you can't build stateful applications on top of it. HTTP本身是无状态协议,但这并不意味着您不能在其之上构建有状态的应用程序。 For instance, by using cookies, this website is maintaining the state that I'm logged in to credit me for this answer. 例如,通过使用cookie,此网站将保持我登录状态以将此答案归功于我。 In many APIs, some form of session identifier is passed with each request so that you can, for instance, build up a basket of items prior to booking. 在许多API中,每个请求都会传递某种形式的会话标识符,例如,您可以在预订前建立一篮子物品。 This can simplify the use of the API, but restrict the order in which operations can happen. 这样可以简化API的使用,但会限制操作发生的顺序。 A RESTful approach might instead let you create any number of baskets and retrieve them at any time, leaving an action such as searching for a product to be truly stateless. RESTful方法可能会让您创建任意数量的购物篮并在任何时候检索它们,从而留下诸如搜索产品为真正无状态之类的操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM