testdriven.com Wrangling quality out of chaos

Refactoring Our Way to Glory (2): Implementing a Save operation

10.04.2004 · Posted in Links

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

  • del.icio.us
  • Digg
  • Google Bookmarks
  • Slashdot
  • StumbleUpon
  • Technorati
  • Twitter
Tags:

Comments are closed