UML Class Diagram for an E-commerce webSite?

17,730

Impressive and comprehensive, I'd say you're on the right track. I don't see any large missteps that would hold you back from moving on to define your sequence diagrams. My comments below are just an opinion and could be debated either way.

You show an association between the storeList and ProductList, which makes sense if you are traking the same products accross stores with a master list of products, like with a parent company and franchised stores, but it doesn't look like your stores are related in that way.

If you are going to have a class for Currency, go ahead and make Price a separate class. This will make it easier to handle changes to prices, like discounts. Also, you show only 1 currency possible per product, what about selling in multiple currencies? You need to think about the sale transaction as a seperate and distinct domain from inventory. A product itself doesn't have a price stamped on it (typically), it is assigned to it and can be updated, not to mention that the same product could be sold for different prices over time or by different stores. What you need is a stock list that contains attributes for product id, the current selling price, and attributes for whatever discounts might be needed along with a history file that contains all changes to the stock list for when you need to check a price on a sale from the past.

For the same reasons as Price, go ahead and move all product description attributes to a ProductDescription class, e.g. color, size, weight, etc. That way if products have a custom attribute type needed (one store sells both cars and software), you only subclass the ProductDescription class, not the Product class.

Share:
17,730
Dan
Author by

Dan

Updated on June 04, 2022

Comments

  • Dan
    Dan almost 2 years

    The diagrams below are my very first attempt at creating a class diagram and the use case diagram describing an E-commerce or Online shopping.

    I'm sure its a poor design and full of flaws, but I'm hoping to learn from you guys how you would design it. I'm particularly interested in your use of design patterns and which patterns you would use, how you would implement it in the design, and why.

    the use case

    Any advise, criticisms, comments and suggestions will be really appreciated. Thanks in advance.


  • Dan
    Dan over 12 years
    i really appreciate for all of your earnest comments, first of all i admit that my currency is weak, i have not completely analysed it since currently there is only one currency but i put it as a separate entity since for next Version i have to support multiple currency. Also your solution for currency is really good Perfect, but.. let explain look like this, in this design a product can only assign to a store, mean different store can have exactly same product BUT the productID IS not the same, so a product is unique for just an store, look like this i can save i product with one currency.
  • Dan
    Dan over 12 years
    and when i want to show it to the customer, i need to the the main base currency of the product price then by the convert currency rate convert it to the currency of target customer, in your opinion this is correct? @Kelly French, i said is your perfect but can i put it on this way? #Second i accept completely that i must create a ProductDescription class, you are Professional
  • Dan
    Dan over 12 years
    # third: sorry for the second paragraph, "You show an association between the storeList and ProductList," Could you please a little more explain it, i misunderstand this paragraph, if i understand your mean, can i say if each productID has uniquely sell just in one one store(i explain in first comment) the issue is solved or not? Thank you very much
  • Kelly S. French
    Kelly S. French over 12 years
    @Danial, if each store uses a unique product ID (even for the exact same item) then you don't need to show an association between storeList and ProductList, just remove the link on the diagram.
  • Dan
    Dan over 12 years
    sorry let me explain it, my English is not perfect, each store has a list of productsID (ProductList), storeList shows the list of all store then when user select an store the productList of that store shows to the customer? is it correct? again you are going to say i remove this association?
  • Dan
    Dan over 12 years
    i means of product look like this, store 1 has product B, and store 2 has also product B, but in this class diagram (specially database) i give 2 different ProductIDs to the two product, as a result each product only refers to just one store,
  • Kelly S. French
    Kelly S. French over 12 years
    @Danial, storeList is associated with multiple stores; each store has its own list of products. That is how storeList is already connected to Product. The only reason I can see to maintain an association between storeList and Product is if you wanted to have a master list of products where each store uses their own ID for the same product like Product(master_product_id, store1_id, store2_id). Let me ask it this way, will you ever need to get a list of all products for all stores and also have that list only contain unique entries?
  • Dan
    Dan over 12 years
    oh i have not think about this issue, i got what is you means, it is a good feature but i have not had plan till now to have this kind of list, but it is really useful i will put it on the second phase (version) of this project. oh one more question in you point of view if i want to implement this one with PHP, java or even Objective-c do u have any estimation for each one of this programming language?
  • Dan
    Dan over 12 years
    I revised it.. please have a looked
  • Kelly S. French
    Kelly S. French over 12 years
    My estimate would be biased because I know Java much better than PHP or Objective-C. Whichever one you already know is likely to be the one that will take the least amount of time. The target platform will influence the language more than the amount of development time. Do you want the app to run on an iOS device with no connectivity? Use Objective-C. Will it be server-based but you don't have a large budget? You'll find PHP more affordable. Do you already know you need to support large scale? If your host supports Java, you'll find Java to scale well for coding and deployment/migration.
  • Dan
    Dan about 12 years
    you comments are really helpful, actually i am about to implemented by PHP, i have worked with java and objective-c, at the moment for me it is easier to used php since i m more professional in php. Just one more thing, i draw the database diagram and put it into question for more details, would please based on the tables of database somehow comment me over class diagram that i have done? actually i provide 2 class diagram one is Independent from any language and the other class is for php, Thanks