Question

For my application i used an architecture Three-tier, with a service/presentation level, business and datalayer. Now i want use web api(without MVC, only controller). Then i think to use a controller like a service, and mantain business and datalayer. But often the controller logic is linked to the output and to the model present in html. Another solution could be use the controller that use the service layer to make what the application required. In this case the controller acts as an intermediary between the model on html and the service that could be used by a tablet or other device.

Which software architecture used in these cases?

Was it helpful?

Solution

Three Tiered. You just need to adjust yout misunderstanding what this means.

Your Web API is not a service, it is a UI layer. It naturally does all the UI tuff - like also reforming business data to the needs of a presentation.

A UI is a user interface - it is not necessarily graphical. In the case of a WepApi, the user is the other program using it to pull the data. And naturally the WebApi will do a lot of stuff that you need to do in any front end - user and input sanitation, transformations to the exact need of the presetnation etc. It is the front end, the presetnation and the end of the application's trust boudary (never trust input you get via WebApi) - only that another program uses it, not a person.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top