Geoff,

Well, if you're modeling the real world here, i suppose a User would be responsible for putting stuff in their cart. That's how it works in the supermarket, isn't it?

Unless you have a store for only the very wealthy. Then you could add a ShoppingAssistant to do that for the User. But the User would still have to tell the ShoppingAssistant what to put the cart, no?

Unless of course your Users were really as dumb as you say they are. Then the ShoppingAssistant would also be The Decider. ;-)

http://www.slate.com/id/2140228/

Bottom line for me, Users usually decide what they put in their carts and do it themselves. Since that's how it works in the real world, I don't see any point in adding a artifact to your model to handle such a simple, straightforward thing.

HTH,

Nando

Hi all

I have a conundrum... Here goes:

1) I have an application scoped store.cfc responsible for pulling out
category and product information from my database.

2) I have a user.cfc, stored in the session scope which holds the users
shopping cart etc.

3) I have an application scoped usermanager.cfc (in this stylee:
http://articles.techrepublic.com.com/5100-3513_11-5543910.html) which
handles locking etc.

My problem is:

I need to add a product to my cart... Which CFC is responsible?

- Usermanager.cfc doesn't know how to contact the database.
- User.cfc doesn't know anything.
- Store.cfc doesn't know about session variables.

In the past, I've used a custom tag, so I'm guessing I need another cfc? Or
should I make usermanager.cfc more clever and give it access to the
database? Store.cfc has a function getProductDetailsforCart() which returns
all the details I need to add to the cart; should it be able to access
usermanager.cfc?

Yes, I probably need ColdSpring / IOC / dependency injection etc, but for
the moment, I'd like to see how it should be done "by hand" so to speak...

Can anyone point me in the right direction?

Much appreciated.

Geoff



______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________


You are subscribed to cfcdev. To unsubscribe, please follow the instructions at http://www.cfczone.org/listserv.cfm

CFCDev is supported by:
Katapult Media, Inc.
We are cool code geeks looking for fun projects to rock!
www.katapultmedia.com

An archive of the CFCDev list is available at www.mail-archive.com/cfcdev@cfczone.org


  


--

Aria Media: Building Internet Business that Works

Aria Media Sagl
CP 234
6934 Bioggio
Switzerland

+41 (0)91 608 2404
+41 (0)76 303 4477

www.aria-media.com



You are subscribed to cfcdev. To unsubscribe, please follow the instructions at http://www.cfczone.org/listserv.cfm

CFCDev is supported by:
Katapult Media, Inc.
We are cool code geeks looking for fun projects to rock!
www.katapultmedia.com

An archive of the CFCDev list is available at www.mail-archive.com/cfcdev@cfczone.org

Reply via email to