On Mon, 19 Feb 2001, Peter Routtier-Wone wrote:

> You correctly describe the desired behaviour but I am not sure about
> precomputation and explicit storage of implied inherited classifications;
> this would introduce horrific opportunity for update anomalies.

i'm not sure what you mean by precomputation here.
the 'dog' will have a superclass of 'canine', inherits from 'animal'.
for object persistance, create, load and store will simply do it's
thing for the 'dog' table, call the superclass create/load/store and trust
them to sort themselves out. so you can minimize coupling and maximize
encapsulation. if you write crap code and fail eg to store the right table
name in the 'classification' table, then yes - you've got an update
anomaly.

> I have written a helper class to expand the set of explicit classifications
> to include all the classifications implied by inheritance. I am hoping that
> this will be enough to simplify finder methods.
by lookups in the db? sounds like your trying to turn your relational
database into an object-oriented data storage!
remember that this is exactly what java will do for you behind the
scene. use the built-in language features instead!

> The only case I foresee in which it will be desirable to have fully
> "flattened" classification (so that SQL can do all the manipulation and
> transformation) is for reporting. For such cases - batch style tasks that
> process *all* the data - I see no problem with preprocessing the
> implications of THINGCATEGORY into a FLATTHINGCATEGORY table.

i hope you don't think i suggested a flat classification structure.
what i wanted to convey was this: your problem can be easily and
effectively modelled with object-oriented inheritance and polymorphism (in
fact what you're talking about is a text-book oo example!) but mapping it
cleanly onto a relational database is next to impossible.
have you considered other alternatives for data storage?
anyhow, if you have to choose between corrupting your design and a
convoluted db structure - well, i think you see which way i'm leaning!

/m



--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
List Help?:          [EMAIL PROTECTED]

Reply via email to