I am planning the implementation of an Inheritance Mapper pattern for an application component http://martinfowler.com/eaaCatalog/inheritanceMappers.html
One feature it needs to have is for a domain object to reference a large list of aggreageted items (10,000 other domain objects)
So I need some kind of lazy loading collection to be passed out of the aggregate root domain object to other domain objects.
To keep my (php) model scripts organised i am storing them in two folders:
MyComponent\
controllers\
models\
domain\ <- domain objects, DDD repository, DDD factory
daccess\ <- PoEAA data mappers, SQL queries etc
views\
But now I am racking my brains wondering where my lazy loading collection sits. It seems to stride both layers. Internally its a kind of data mapper, externally its a domain object.
Any suggestions / justifications for putting it in one place over another another?
- daccess = data access
- DDD = Domain Driven Design Patterns, Eric Evans - book
- PoEAA = Patterns of Application Architecture Patterns, Martin Fowler - book