Refactoring Our Way to Glory (2): Implementing a Save operation
Steve Maine writes: "To recap, there are few simple rules that I’m trying to stick to as I grow this pattern. They are:
- Entities do not perform their own lifecycle management. The persistence of an entity is handled by its Repository, and its instantiation is handled via its Factory.
- Each entity talks only to its own repository.
- Repositories talk to other Repositories through the RepositoryFactory.
- Avoid singletons as much as possible."
link






