in reply to Beginner OOP style question
You might try to export a generic 'search' method, assuming
you don't have to create a new database handle for each
object .. possibly have the search method retrieve a list
which can then be passed to a 'load' method which would
instantiate SomeObject for each item so loaded? When your
code tries to do two distinct things (dealing with your
objects and dealing with moving those objects in/out of
secondary storage), that is the place to design a dividing
line, or use/author another module altogether.
|