Any downside saving shopping cart in Profile? Profile Migration?
I'm doing some research for my project where I'm gone have a shopping cart. I been reading some and one way that shopping cart seem to be handled in mvc is to save it to the Profile and later on save it in the db after order is complete, and [Serializable] on the 开发者_StackOverflow中文版class.
My question is do you see any downside doing it like this with the profile?
EDIT
I think I found a downside saving the cart to profile and that is the migration from anonymous to authenticated user. I'm currently working on Web Application Project so The migration solutions I found don't work (in the global with Profile Common). I found some useful information recently but I want to ask here one thing tho. The info I found is I can get and set the properties in the profile, but the migration part is still unsolved. Anybody got any tips on this or solution that can point me in the right direction?This is the classic it depends.
Size is the biggest draw back I can see.
It depends on the size of your object. You could have a very large object when really all you need a list of ProductIds that is in the user cart. Could be allot of bytes compared just a few.
If I was doing something like this I would just save a list of the Products in the shopping cart. There might be more information needed (like qty), but I would try to save the bare minimum to keep the read/write as small as possible.
When you Seialize a class it if you use Xml you get an element for each property. Binary is a little more compact (which is what I would choose).
An additional downside is session length. If session times out, how do you want to handle the cart?
精彩评论