[thelist] worldusa.com sucks
Matt Warden
Matt Warden" <mwarden at odyssey-design.com
Mon Apr 3 18:28:14 2000
I came to my laptop today, dialed in to my ISP (can't wait until we get
cable modem capabilities in my area) and what do I see my browser
default to as the home page? None other than Worldusa.com. What the fuck
is worldusa.com? I've never been there and I *certainly* wouldn't have
made it my home page. I swear, if IE let some JavaScript alter my home
page settings, I'll be pissed! Well, screw IE, right? I just use
Netscape. What the hell! Guess what my home page is on Netscape too? I'm
about ready to beat some ass. Anyone had an experience like this? I'm
thinking that I downloaded some adware or something that screwed with my
browser settings. Damn I'm pissed.
What's the rule now? The number of tips owed is equal to the number of
curse words squared? I'll catch up later. One for now :)
<tip>
Let's say you have a database table that holds... oh... how about a
shopping cart. You could create a table to relate a shopping cart to
shopping cart items (one to many). Or you could use a makeshi(f)t data
cube like structure using XML. Oh, let's say you have this in your
current shopping cart minischema (let's keep it simple):
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>
...
As you can see, we just eliminated the fields: ID and CART_ID. You would
probably want to employ some middleware to take care of adding products
to the cart that already exists in the cart (i.e. incrementing the
quantity -- but the hard part is checking to see if the product exists
in the cart).
That said, let me say that I haven't actually used this in a live
environment, but it seems like it would work well, provided that the
database could handle large strings of XML for big, many-itemed carts.
</tip>
--
Matt Warden
http://mattwarden.com
me AT mattwarden DOT com