A. Duplication: -
Each class loads the database driver (just in case). -
Each class defines a create() method (similar but not identical). -
Many find() and update() methods are similar. -
Test classes have duplicate setups. Test cases could communicate better. (How about an explanation string on the less obvious asserts?) Divergent change: classes depend on both the database and the domain. Course and Offering pretty much consist of public access methods, with little behavior of their own. We may be missing some collection classes. B. Create() creates the object in memory, and all() or find() can locate an existing copy. Code manipulates the object in memory and then calls update() to write it. There's no general approach to deleting objects. |