external API in three-tier architecture?
https://softwareengineering.stackexchange.com/questions/405885
-
08-03-2021 - |
Frage
I am making a data visualization application in Unity game engine that simply shows data in a 3D environment using google maps API.
I am using the three-tier architecture to explain the application. It has the following layers
- Presentation Layer Shows the visualization
- Logic Layer Transforms the data as per logic from the API and gives it to presentation layer
- Resources Layer google maps
My question is, where does the API call module goes, the one which requests data from google maps. Should it be in-between the logic and resource layer as another layer?
Or am I doing something wrong here...
Lösung
In a typical three-tier architecture, the logic layer is responsible for everything that isn't presentation and data.
That includes (this is not an exhaustive list) calculations, processing data, making decisions, etc. But most applicable to the question, it is responsible for moving data between the other two layers (usually transforming it on the way).
So any component, application, software that you want to articulate that makes the call to the API in the data/resource layer exists inside the logic layer.
If you wanted to split the API call module out of the logic layer, you'd then have a four-tier architecture (perfectly good) where your logic layer is split into a business logic tier and a data access tier.
Image sources are https://en.wikipedia.org/wiki/Multitier_architecture#Three-tier_architecture and http://vbsoftwaredeveloper.blogspot.com/2013/05/4-tier-ioc-application-converted-tier.html