First I'm going to "not answer" your question in the same way that Jon
did. Then I'll answer it, OK?
What would you think of someone who asked you which was faster, a flat
file or a database? What's the correct answer? What's the correct
answer if the usual reaction of someone who asks such a question is to
then run off and use flat files for everything, because they're
"faster"?
The answer, if course, is "it depends," and "one doesn't decide between
a flat file or a database based on speed, but based on any number of
other considerations." That's the answer you got from Jon. Given that
this topic comes up every couple of weeks here, couched in the exactly
the same terms, can you blame us for giving a big sigh and giving the
answer we did?
We discuss this issue all the time. You can read some background here
http://groups.google.com/group/micr...ges.csharp/browse_frm/thread/19815c2abf29d89f
and here
http://groups.google.com/group/micr...rp.general/browse_frm/thread/51ef2f65740a80e3
in a couple of threads in which I was involved.
Now that that's out of the way, here is the answer that I hope you're
after.
1. Structs are faster (and make more sense) if you want something that
will act like a value: like an int or a decimal. If you want it to
participate in comparisons and traditional calculations.
2. Structs are faster if they are involved in calculations that produce
large numbers of intermediate results. This is why (IMHO) Microsoft
chose to make Point and Rectangle as structs: they are both involved in
complex calculations that yield large numbers of intermediate results.
This latter point is because allocating all of those intermediate
results on the stack (with no need for later garbage collection) is
cheaper than allocating them on the heap (with the requisite garbage
collection afterward). However, the numbers of throw-away results have
to be pretty high to justify this.
On an e-commerce site, I assume that you have a database somewhere. I
can guarantee that you will spend 10,000 times as long getting things
in and out of a database than you would possibly ever save by fiddling
with structs versus classes to represent products.
If you want a good use for structs in your context, try this one: a
MonetaryAmount struct that contains a decimal quantity, a currency
code, and a DateTime, and knows how to convert itself into other
currencies.