Food Ordering System UML Class Diagram

Viewed 1800

I am trying to create a food ordering system for my homework. I learnt terminolgy which like aggregation,composition,inheritance etc. But when i trying to build diagram im confusing about how i need to design.

For beginning i created some classes:

  • User
  • Customer
  • Vendor
  • Restaurant
  • Food
  • Order
  • Order Details
  • Shipping Info
  • Shopping Cart
  • Payment

enter image description here

I linked some of them but it got worse as it continued.

Is there any suggestion how i design this or what my mindset has to be ?

(Note: I don't need any coding. Just diagram drawing.)

1 Answers

You use too much the composition, this kind of relation is very strong, for instance having vendor <*>---restaurant means when the vendor disappears (dies) the restaurant disappears too, which is wrong

In your case the compositions are not even aggregations, for instance the shopping card is not a part of a customer except if it is tattooed on him ;-)

The inheritances between order details and shipping info with order is wrong, A inherits B means A is a B., Note you can have the composition order <*>---- order details supposing the class order details has a sense.

payment method can be used in class-associations between a customer and the restaurant.

You can specify the multiplicities in your relations, and all of them do not bidirectional.

I encourage you to name the classes with an uppercase character at the beginning of each word (OrderDetail etc)

(You have some free UML tools to avoid to use a pencil)

Related