[thelist] worldusa.com sucks

Scott Dexter sgd at ti3.com
Mon Apr 3 18:55:10 2000


My comments below--

> 
> CART
> ---------------
> ID
> CREATED_DT
> 
> 
> CARTITEMS
> ---------------
> ID
> CART_ID
> PRODUCT_ID
> TAXCATEGORY_ID
> QUANTITY
> [blah, blah]
> 
> 
> You can eliminate the second table altogether by adding a 
> field to CART
> called ITEMS_XML or whatever. Within ITEMS_XML would be stored:
> 
> <item>
>     <prodid></prodid>
>     <taxcatid></taxcatid>
>     <quant></quant>
>     ...
> </item>
> <item>
>     <prodid></prodid>
>     <taxcatid></taxcatid>
>     <quant></quant>
>     ...
> </item>
> ...
> 

the only thing is, you lose referential integrity this way. How can you
ensure that the product id refers to an actual product? What about the
TaxCategory_ID? what about manipulating the quantity of the item in
question? How do you find a specific item within a cart?

My point is doing something this way may introduce a lot of extra coding
that you could be done by the db if it was its own table.

now, pulling the data outta the second table (CARTITEMS) and sending it to
the browser in XML and doing some client side presentation with it (being
able to sort, add, delete, etc) and then sending the XML back to the server
to be parsed and inserted to the table would be a good use of XML ...

(of course, all this is my opinion, and I'm not going to disown you if you
do something this way)
sgd
--
think safely