0

Please, consider three pictures, I found in internet:

1:

enter image description here

2:

enter image description here

3:

enter image description here

I always thought, that REST and SOAP services are in service layer - see #1. However, if you look at #2, you'll see, that presentation layer provides restful service. #3 shows, that presentation layer includes only REST services, but not SOAP.

So, does presentation layer include REST and SOAP services?

0
4

The reason that diagram 2 calls this the "presentation layer" is because that's the conceptual "layer" in which REST is presented in ASP.NET MVC It's essentially an "end-point."

The reason that diagram 1 calls this the "Service Layer" is because that's where SOAP and REST are represented in that diagram. The "Presentation Layer" represents the UI in that diagram, so the diagram needs to call the layer that contains SOAP and REST something else.

Why are they different? Because that's how the world works. People co-opt different terms to suit their different purposes.

9
  • Do I understand you correctly - there is no generally accepted definitions where rest/soap services must be placed. So, they can be either in presentation layer or in service layer. Both variants are correct. Right? – Pavel Nov 30 '20 at 19:33
  • I think there's a typo and the second paragraph refers to diagram 1. – Rik D Nov 30 '20 at 19:35
  • 1
    @Pavel: Just like how the meaning of "presentation" can shift in a different context, so can the meaning of "services". The issue here is that you seem to expect that there is exactly one rigorous definition for each name you encounter. There isn't. – Flater Dec 1 '20 at 16:20
  • 1
    @Pavel: Let me try to say what they are getting at in a different way. It's not that there is this template that says that there are Data Layer, Business Layer, Service Layer and Presentation Layer, and then developers say "we'll put this into the Service Layer" or "we'll put this other thing into the Pres. Layer". It's that developers decide how they'll conceptually divide the system into layers; they decide what the layers represent exactly, how they are going to call them, how many of them will be there. 1/2 – Filip Milovanović Dec 1 '20 at 17:10
  • 1
    It's just that certain ways of dividing the system into layers are common; but even then, what exactly each layer represents conceptually may be subtly different and depends entirely on the developers architecting the system (depends on how they think about it). In 3, they simply don't think about the service layer as being a separate layer. Regarding your question: in principle, REST & SOAP aren't presentation in general; however, they are either not being too careful about that here, or are trying to emphasize that these are, in their system, geared towards supporting a frontend. 2/2 – Filip Milovanović Dec 1 '20 at 17:11
2

There are many layered architectures; some use the same names for layers with slightly different responsibilities.

It also depends on what you consider the boundaries of the application. If you're making a REST service for others to consume, it's not uncommon to call the layer that contains the endpoints the Presentation layer.

If you're also building the application that consumes the REST endpoint, your effectively building two separate applications. The end-users and other stakeholders might not see it that way, but technically they are two separate applications, each with their own layers. And depending on the chosen architectures, some of these layers could have the same names.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.