[thelist] DB Schema Design

Hassan Schroeder hassan.schroeder at gmail.com
Mon May 8 12:03:44 CDT 2006


On 5/8/06, Matt Warden <mwarden at gmail.com> wrote:

> > Regardless, mixing attributes of different "things" in one table,
> > simply because they have a common name, just feels wrong to me.
>
> They are not different. They're all statuses. You seem to be viewing
> status as an attribute, while I'm viewing status as an entity (it has
> its own table, right?) with an attribute specifying its type.

Absolutely. A "Customer" or "Product" is clearly an entity with attributes;
there is no "status" in the absence of the thing to which that status relates.
Hence I consider status an attribute. Again, YMMV, TMTOWTDI, etc.

> > unless Customer and Product either had a super/subclass
> > relationship, or both extended another object with a getStatus()
> > method.
>
> And they should, lest you duplicate code.

We'll have to agree to disagree on that one, too :-)

Different objects, different methods.

FWIW,
--
Hassan Schroeder ------------------------ hassan.schroeder at gmail.com



More information about the thelist mailing list