I'm studying about 3-tier architectures and I have an issue to which I can not really seem to find a solution. Eventhough there are a lot of articles on the net about 3-tier architectures, none of them mention data models. Except in the context of MVC.
I have the following architecture:
So what we see here is that each layer uses the data model. Suppose I have a new user that subscribes:
UI : * Get the data from the http request
* Build a `UserModel()` with this data
* Pass this `UserModel` to the application layer
APP: * Pass the `UserModel` to the DB layer
DB : * Format the `UserModel` to SQL and write to DB.
So effectively all layers have a notion of this data model. I'm wondering if this is in fact the whole point?
In contrast, suppose I wanted to resolve this I could make the UI pass the "raw" data (i.e., the values for a user in string format) to the application layer. The application layer would be the only layer that has a notion of the UserModel. It would thus create the UserModel
with this data. How I would then proceed to pass it to the database layer without the DB layer having the notion of the model is tricky. So I have no clue on how to that.
In short, I'm pretty stuck. Any help is greatly appreciated.