views:

36

answers:

1

Could someone clear something up for me? As far as my understanding goes, the physical model describes how the data is represented in the context of a specific storage medium. The logical model is a representation in terms of entities and relationships, independent of any particular data management technology. How do these two work with Entity Framework? I assume the EF works against a logical model. In which case, where does the physical model fit in?

+1  A: 

In the EDM (Entity Data Model) the first one is represented by Store Schema Definition Language (SSDL) and the secound one by Conceptual Schema Definition Language (CSDL). But, there is also a third player in this game: Mapping Specification Language (MSL).
In the Entity Framework metadata, the mapping layer sits between the conceptual and store layers and provides the map from the entity properties back to the tables and columns in the data store.
Ef, as an ORM, works with all three. Developer codes against the Conceptual model and EF maps it back to the storage model using the MSL.

Morteza Manavi
Thanks for the response. I knew the above. What I am a little unclear about is where the storage model actually fits in with regard to my definition. If the EDM is mapping from a logical model to the conceptual model, how do we get from the logical model to the physical model? Or is the storage model in EF also the logical model in which case we lose that abstraction where the logical model is database storage medium independent? Or am I missing something? Thanks again.
Jon Archway
Or are we saying that the MSL is the logical model?
Jon Archway
Logical model and Conceptual model are basically the same thing. It's just calling the same thing with 2 names. When you are looking from a "Domain Model" perspective it's Logical Model, when you have ORM point of view, it makes more sense to call it Conceptual Model, but really it all refers to your object model that has been mapped from your database tables (aka Storage Model) by EF.
Morteza Manavi
But from my understanding the logical model and physical model from a data architects point of view would mean that a logical model is different from a domain model from a software architects view. The physical model is focused to the specific db e.g. Oracle/SQL Server, the logical model is abstracted away from the database implementation but still db focused, the conceptual/domain model is the OO model representation and different due to the focus being from the business without being driven by storage concerns. Unless my understanding is incorrect here? Thanks
Jon Archway
"A logical model is a static view of the objects and classes that make up the design/analysis space. Typically, a Domain Model is a looser, high level view of Business Objects and entities, while the logical Model is a more rigorous and design focused model."
Morteza Manavi
Based on the above definition, I think it's fair to think of EF Conceptual model as logical model since it's the first stop in the application when you are coming from DB storage model. However, depends of how much sophisticated your architecture is, there might be yet another abstraction as Domain Model, on the top of Conceptual layer but in many systems I saw that the EF generated objects from Conceptual model also act as Domain Model.
Morteza Manavi