in reply to Question to OO Masters (about Style)
Figure out what you need to do, and write objects to do those things. The actual data will tend to fall out from there.
Looking at the problem very quickly, I'd probably make the Entries do their semantic checks. If it's necessary to do a global check in a Dictionary, I'd probably write something like check_all() that just iterates over the collection.
If you need similar behaviors that can apply to an Entry or Entries, it may be worth breaking those checks out into separate classes. It's hard to say, but I'd revisit the design. It may be more flexible elsewise.
|
|---|