Interesting. Using composition of objects like that is a sensible enough approach. What about also just implementing lazy loading in your domain objects. If you try to get details of a user and it's already been fetched from the server, then great. If not then fetch it from the server. I guess that's what you're doing in a way, but with lazy loading, the fetching logic would be tied to the entity class and the rest of the application doesn't need to care.
Comments
Interesting. Using composition of objects like that is a sensible enough approach. What about also just implementing lazy loading in your domain objects. If you try to get details of a user and it's already been fetched from the server, then great. If not then fetch it from the server. I guess that's what you're doing in a way, but with lazy loading, the fetching logic would be tied to the entity class and the rest of the application doesn't need to care.