Domain Model and Data Mapper
Results 1 to 3 of 3

Thread: Domain Model and Data Mapper

  1. #1
    Senior Member
    Join Date
    Sep 2011
    Posts
    258

    Domain Model and Data Mapper

    Well I am considering working on an ORM system for my script, but there are some tough decision decisions to make. In Matt Zandstra's book PHP Object, Patterns and Practices, he introduces several possible database design patterns. Among them the most recommended ones are data mapper and identity object, I still have a few confusions though.

    1. What does a Domain Model fit in the world of MVC? Is it pretty much a Model? Or is it just some kind of strongly typed Raw Data with no functionalities?
    2. Are Domain Models supposed to keep a reference of Mapper object? Or are they only supposed to hold data?
    3. What is the difference between a Domain Model Object and an Identity Object? Is Identity Object the same as Doctrine/Propel's Entity Object?

    Sorry for asking this many questions at the same time, I just really hope to get a complete understanding of how these are supposed to work. It seems that Symfony has an ORM system inside its MVC architecture design, so apparently ORM and MVC aint incompatible with each other. Right?

  2. #2
    Senior Member
    Join Date
    Jul 2007
    Posts
    3,657
    Having no practical experience with MVC, this is from how I understand it works by reading about it. The model is responsible for mapping data between persistent storage, almost always a database, and making it accessible to your program, almost always class instances. ORM is a way to facilitate mapping data between databases and objects. Thus, your model can make use of an ORM to facilitate this mapping, and it will usually mean that you have to write less code for each particular table/object pair.

  3. #3
    Senior Member
    Join Date
    Sep 2011
    Posts
    258
    Well I just wanna know what the relationship is between a Model in MVC and the objects in ORM. Is it safe to assume that in ORM the Model is decomposed into Mappers, Entities, Identity Maps/Object and possibly Domain Object Factory? Anyone of you familiar with Matt Zandstra's book chapter 13 on database patterns? o_o

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •