OOP App Architecture: Which layer does a lazy loader sit in?
- by JW
I am planning the implemention 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.
Any suggestions / justifications for putting it in one place over another another?
DDD = Domain Driven Design Patterns, Eric Evans - book
PoEAA = Patterns of Application Architecture Patterns, Martin Fowler - book