In a distributed application, we might have different layers deployed in different physical machines and there would be well-defined responsibilities for each layer, communication between the layers using a standard protocol/interface.
Main intent of moving a layer to a different location would be 1) Security (sensitive data store/business logic behind firewall) 2) Scalability 3) Integration with other applications etc.
Main intent of moving a layer to a different location would be 1) Security (sensitive data store/business logic behind firewall) 2) Scalability 3) Integration with other applications etc.
Assuming that a distributed application has three layers:- 1) UI/Presentation Layer, 2) Business Layer 3) Data Access Layers, I believe that application would have the following object models 1) View Model, 2) Domain Model 3) Data Model (Conceptual Object Models) 4) Object Model for communication between different layers(in different physical locations).
The purpose of all these Object models would be different.
I believe the purpose of View Model is to provide an efficient way of binding UI Controls with the appropriate data and to collect the data from the user , validate it and pass it on to next layer.
I believe the purpose of Domain Model is to organize the data and processing code in the BLL more meaning full way. All objects in this model represents tangible real-world objects (The purpose of any software system I believe is to automate a manual business process and Domain model can be derived from the real-world entities that will be involved in that manual process).
And database conception model purpose is to efficiently retrieve data from physical data store, manipulate data efficiently in the physical data store. The design of database schema will be done considering efficiency of storage, scalability, performance of data access not based on UI or BLL requirements. So the conceptual model of data might not completely resemble the Domain Model.
A Data Model might have all the traits of Domain Model like : Repositories, Services, Aggregates, Entities, Value Objects and Bounding Contexts. But the purpose of Data Model is quite different from Domain Model.
In most of the two-tier applications, Data Model and Domain Model will be the same. But it is recommended to have a separate Domain Model containing objects with domain specific behavior.
And Object Model for communication between layers(DTO's, messages etc) focuses on secure , reliable marshaling and transferring of data between layers.
Since the model in each layer are related but might not be exactly same, we need a mapping mechanism for
A Data Model might have all the traits of Domain Model like : Repositories, Services, Aggregates, Entities, Value Objects and Bounding Contexts. But the purpose of Data Model is quite different from Domain Model.
In most of the two-tier applications, Data Model and Domain Model will be the same. But it is recommended to have a separate Domain Model containing objects with domain specific behavior.
And Object Model for communication between layers(DTO's, messages etc) focuses on secure , reliable marshaling and transferring of data between layers.
Since the model in each layer are related but might not be exactly same, we need a mapping mechanism for
- Physical data store <===> Conceptual Data Model
- Data Model <===> Transfer Model (Not always required)
- Domain Model <===> Data Model
- Domain Model <====> Transfer Model
- Transfer Object Model <====> View Model
No comments:
Post a Comment