Re: Re: A design Q

From: Date: Sat, 01 Jul 2000 16:19:14 +0000
Subject: Re: Re: A design Q
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-4267@lists.php.net to get a copy of this message
Hi Richard! On Fri, 30 Jun 2000, Richard Lynch wrote: > > I am prototyping a Cart, and I am not decided where should > > I put the `Product ID'. From a design point of view it's a > > link attribute (it has a meaning only in the relation Product->Cart, > > which is an agregation, so I'll have an internal hash for this). > > If *I* was doing this, I'd have three tables: Products, Carts, and Shopping > > Carts would pretty much just be an ID generator, so in some SQLs, it would > just be a sequence, not a table. In MySQL, you're stuck with a table with > an auto-increment, I think. Oh, I was talking about classes. So far I am not concerned with any tables. All the needed data is provided through a wrapper function. I am seduced by the Model-View-Controller pattern (aka Model 2 in JSP) so this was an object not DB design question. I ended in having only 2 classes for the Model : Product and Cart and a CartView for the View. The Q was on Product and Cart classes, which one should keep the product id (aka SKU).Going back to my OMT knowledge I chose it to be in the Cart :) Thanks for answering though. -- teodor

« previous php.general (#4267) next »