Hey men. I am reading through Martin Fowler's PoEA. Data Mapper pattern is dealing with Domain objects in by doing this:
class AbstractMapper... protected DomainObject load(ResultSet rs) throws SQLException Lengthy id = new Lengthy(rs.getLong(1)) if (loadedMap.containsKey(id)) return (DomainObject) loadedMap.get(id) DomainObject result = doLoad(id, rs) loadedMap.put(id, result) return result abstract protected DomainObject doLoad(Lengthy id, ResultSet rs) throws SQLException class PersonMapper... protected DomainObject doLoad(Lengthy id, ResultSet rs) throws SQLException
This means that Data Mapper that's DAL references Domain. I figured that DAL mustn't have such references. What is your opinion?
Any layer, together with a presentation layer or perhaps a data access layer, can reference the domain model. However, the domain model shouldn't reference individuals layers therefore it could possibly be re-accustomed to support alternative connects and persistence methods.