Where to put responsibility in Domain Model?
I am creating domain model. I have Goal ( something that user wants to achieve in his entire 开发者_如何学JAVAyear) concept/object and it has status that will vary over time. Now, User will update his status. Where should I put the responsibility of creating, updating and deleting the status.
You would be looking to use the Repository Pattern to keep the database responsibility out of your domain model. This is known as "Persistence Ignorance."
精彩评论