The idea of separating the data store behavior and the Person seems right to me, but having the Person object contain the storage objects seems backwards. I use the Class::StorageFactory approach myself.
That is, there's a factory for loading and saving objects. You create, retrieve, and store objects via the factory. The objects themselves don't know anything about their storage.
That does sometimes fail if you want autosave on destruction behavior for the objects, but there are ways around that too -- add a DESTROY hook to the objects that calls the factory appropriately.
In reply to Re: OO design.
by chromatic
in thread OO design.
by lanta
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |