Any examples of online store + shopping-cart classes?
From: Lisa Kim (lisa.kim_at_stanford.edu)
Date: 01/10/04
- Next message: Harry Erwin: "Re: Set Theory and OO"
- Previous message: Dave Harris: "Re: Unix and OO Avoidance"
- Next in thread: Wolfgang Keller: "Re: Any examples of online store + shopping-cart classes?"
- Reply: Wolfgang Keller: "Re: Any examples of online store + shopping-cart classes?"
- Reply: H. S. Lahman: "Re: Any examples of online store + shopping-cart classes?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 10 Jan 2004 21:08:01 GMT
I'm just starting to learn OOP. I'm finally starting to "get it", which is
a wonderful feeling.
But now that I've seen examples of ATMs, cars, blackjack games, I'm want to
try making a UML for something tougher, that's got me stuck.
I know there must be examples of classes for an online store out there, but
I can't find any.
In particular what I'm stuck on are the "items" class, because stores like
Amazon have created interesting non-physical-world situations like this:
SITUATION: an item is in your cart, but if you buy it at the same time as
another item, the price on each of them is discounted.
EXAMPLE: "Each Harry Potter book is $20. But buy any two of them and
they're $18 each. Buy all five, and they're $15 each."
What object would be responsible for making that happen?
The "book" object, for knowing what combinations of things it's mixed with
would lower its price?
The "cart" object, for knowing all combinations of things that might be
discounted?
I'd like to think it's like a "storeOwner" object : the man with the
moustache that decides these kinds of things. But hey that'd be a God
Object and that's not wise. :-)
Any suggestions appreciated. Thanks!
- Next message: Harry Erwin: "Re: Set Theory and OO"
- Previous message: Dave Harris: "Re: Unix and OO Avoidance"
- Next in thread: Wolfgang Keller: "Re: Any examples of online store + shopping-cart classes?"
- Reply: Wolfgang Keller: "Re: Any examples of online store + shopping-cart classes?"
- Reply: H. S. Lahman: "Re: Any examples of online store + shopping-cart classes?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|