let's imagine we have an object User with a property of type Profile that can be accessed by the method getProfile and since we don't need the User's profile for every operation we decided to lazy load the User's Profile. But now, what happens when we decide to update the User object in the database using it's DataMapper? Using the most simple approach would make the User object load the Profile and then save it to database.But it is easy to see that loading an object from the database just to save it again it's useless. What would be a good design choice for this situation?
Data Mapping object with lazy loaded properties
design;design patterns;architecture;software