[thelist] DB Schema Design

Hershel Robinson hershel at galleryrobinson.com
Mon May 8 10:47:29 CDT 2006


> In an OOP context, though, methods ("functions") don't exist in a
> vacuum -- they belong to objects.
> 
> So Customer.getStatus() and Product.getStatus() would be entirely
> different unless Customer and Product either had a super/subclass
> relationship, or both extended another object with a getStatus()
> method.

This is an excellent point. I have scoured the web now and it appears 
that PHP indeed supports objects. So it could well be that even though 
this project is in PHP it will also be OOP. Seems that these are not 
actually mutually exclusive terms. ;)

The point above however is well taken--generally speaking a customer an 
order and a product will be from entirely unrelated classes and 
therefore it seems to follow that their data would also ideally be 
stored in unrelated tables.

OTOH were this project built in an MVC framework, each table would be 
represented as an instance of a Model object and thus could indeed have 
access to the same generic getStatus() function which could be defined 
for the overall Model object. Still, from an information storage and 
information hiding viewpoint it seems to make more sense to me to keep 
object-specific data in an object-specific table.

Thanks,
Hershel

-- 
Gallery Robinson Web Services
http://web.galleryrobinson.com/



More information about the thelist mailing list