Posted by C. on 10/31/78 11:33
Like any database driven program you should start by defining your
schema - i.e. normalise your data. I'm forever finding people whom have
been nitten by the OO bug trying to use persistence as a way of storing
their data - trust me it's a very bad starting point. Trying to fit
your objects and impose persistence on top of an existing schema is a
very bad way to do things.
Assuming that Published, Unpublished and _Backed-up_ are mutually
exclusive and the item must be in one of these states then there should
only be one logical table. These are states of the item (not
properties).
If you can't fix your database schema then using the base class to
abstract the error seems like a good solution.
If there is adequate polymorphism in a relation then WTF do you need to
create derived classes to describe different content types?
C.
Navigation:
[Reply to this message]
|