I've been doing this ever since I started writing e-comm systems in the 90's. 
I'm still not convinced I love the approach as for high volume sites sharing 
the table between often updated carts and historic orders isn't ideal. I think 
going forwards I'm gonna look at using a key-value store for the baskets and a 
relational db for orders, but it's gonna have to wait for a client with some 
kind of scaling requirements - or maybe I'll write a sample as a demo for NoSQL 
presentations . . .

On Dec 9, 2010, at 9:26 AM, Bob Silverberg wrote:

> In the most recent system that I wrote that uses ORM and requires
> baskets/orders I just have one entity: order.  It also serves as the
> basket.  If there are properties that I only need for the basket, but
> I don't need to persist for the order then I make them non-persistent
> properties.
> 
> This worked well for me,
> Bob
> 
> On Thu, Dec 9, 2010 at 7:56 AM, John Whish <[email protected]> wrote:
>> Hi,
>> 
>> I've built an shopping cart using ORM and currently the user has a
>> basket which is persisted, when the user starts the checkout process,
>> then an Order object is created and the Basket is associated to the
>> Order. This all works fine.
>> 
>> The problem I have is that when the order completes, I clear the
>> Basket (which maps to the Baskets table) when the order completes and
>> store the ordered items in a OrderLine object (which maps to the
>> Orderlines table). I do this because I want to keep the Basket table
>> nice and light and not concerned with historic data (passed orders).
>> The trouble with this is that I then have a 1 to 1 relationship
>> between an Order and a Basket (until the order completes) and also a 1
>> to 1 relationship to the OrderLine object (for completed orders).
>> 
>> Is there a more elegant solution to this that I'm missing?
>> 
>> Thanks.
>> 
>> - John
>> 
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "CFCDev" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to 
>> [email protected].
>> For more options, visit this group at 
>> http://groups.google.com/group/cfcdev?hl=en.
>> 
>> 
> 
> 
> 
> -- 
> Bob Silverberg
> www.silverwareconsulting.com
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "CFCDev" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/cfcdev?hl=en.
> 

-- 
You received this message because you are subscribed to the Google Groups 
"CFCDev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/cfcdev?hl=en.

Reply via email to