Class Design and Structure Online Web Store
Posted
by
Phorce
on Programmers
See other posts from Programmers
or by Phorce
Published on 2012-12-01T19:56:40Z
Indexed on
2012/12/01
23:18 UTC
Read the original article
Hit count: 371
I hope I have asked this in the right forum.
Basically, we're designing an Online Store and I am designing the class structure for ordering a product and want some clarification on what I have so far:
So a customer comes, selects their product, chooses the quantity and selects 'Purchase' (I am using the Facade Pattern - So subsystems execute when this action is performed). My class structure:
< Order >
< Product >
<Customer >
There is no inheritance, more Association < Order > has < Product >, < Customer > has < Order > .
Does this structure look ok? I've noticed that I don't handle the "Quantity" separately, I was just going to add this into the "Product" class, but, do you think it should be a class of it's own?
Hope someone can help.
© Programmers or respective owner