0

I am trying to learn domain modeling , now lets consider a shopping cart example.Lets user can browse catalog of products and add products to shopping cart, purchase those products.To purchase products he will place order.User can trace his order details.He can call up customer rep to know about status of his order.

Please validate my Domain model in full scope.

Below is Domain Model i have designed , i am having issues in representing order and order status what is the right way to do How would i link product and order.

enter image description here

sumedha
  • 473
  • 1
  • 9
  • 24

2 Answers2

1

A (conceptual) domain model is a solution-independent description of a problem domain produced in the analysis phase of a software engineering project. It may consist of information models (typically in the form of UML class diagrams), process models (typically in the form of BPMN diagrams), and possibly other types of models.

A domain class model contains only conceptual elements, such as properties (possibly without datatypes) and associations. It does not specify the visibility of properties and methods, as visibility is a platform-specific concept.

Your model is incomplete in many respects (e.g. it does not describe order lines/details, which are taken from the cart), and it does not contain any association. Clearly, an order is associated to one customer and to many items/products (via its order lines).

OrderStatus should be modeled as an enumeration, which is a UML datatype that is stereotyped with <>, and Order should have a status attribute with this enumeration as its range.

The model below may be a bit more general than what you had in mind, because it allows for several warehouses from which an order item can be sourced, and it also distinguishes between private and corporate customers.

enter image description here

Gerd Wagner
  • 5,481
  • 1
  • 22
  • 41
  • I am quite confused with orderstatus as enumeration , i feel orderStatus can have enumeration of status and order can have orderStatus as reference.May be we are saying same thing interchangeably.Another thing i have specified details of order if i create another class with order details would it be better. – sumedha Sep 10 '14 at 15:40
  • As I have added to my response, an enumeration is a simple datatype, so there is no need for a reference/association. You should add a class `OrderLine` many-to-one-associated to `Order`. The items from the cart become order lines as soon as the shopping cart is confirmed. – Gerd Wagner Sep 10 '14 at 16:04
  • You don't need an association with OrderStatus when you have a property/attribute with OrderStatus as its range. Also notice that we don't use navigability arrows on associations lines in a domain model (navigability is an implementation issue). However, we normally annotate both association ends with multiplicities. See my updated answer, which now contains a model. – Gerd Wagner Sep 11 '14 at 15:14
  • Does the new updated Domain Model make sense, I have introduced another entity called PQuantity which will hold product and its quantity . – sumedha Sep 12 '14 at 14:11
  • No, it doesn't make sense. Quantity is not an entity , but a property of `SalesOrderLine` (see the diagram in my answer). It receives its value from the corresponding property of the `ShoppingCart` object from which the new `SalesOrder` object is created. – Gerd Wagner Sep 12 '14 at 15:17
0

You can make "order details" an associative class for the relationship between order and product. See the example:

IBM example of an associative class

Note that yours is really a class diagram. A domain diagram shows the dependencies on different problem domains such as

  1. Order fullfillment
  2. Database
  3. RemoteCommunications
  4. SystemMaintenance
  5. etc.
Bruce
  • 2,230
  • 18
  • 34
  • You seem to be confused about the meaning of "domain model". Of course, a domain information model may have the form of a UML class diagram. See also http://stackoverflow.com/questions/21265491/what-is-the-difference-between-a-domain-class-diagram-and-a-design-class-diagram/21285190#21285190 – Gerd Wagner Sep 11 '14 at 20:23