0

So I'm currently studying UML and I have a question regarding the difference between a Domain Model how this is compared with an Activity Diagram. I a bit confused with the following terms:

  • Activity Diagram (AD)
  • Domain Model (DM)
  • OO Domain Model (OO DM)
  • Class Diagram (as a term)
  • Domain Class Diagram (CD)
  • Design Class Diagram (DCD)

In Visual Paradigm, you have two the option between Activity & Class Diagrams to draw out your designs. So far I have been using Class Diagrams for my Domain Model but a friend of mine told me you should not be using Class Diagrams for your Domain Model. So my question what's the difference and how does a program like Visual Paradigm differentials with the standards of the subject I'm trying to learn.

Jens Ingels
  • 806
  • 1
  • 9
  • 12
  • See also https://stackoverflow.com/a/3509105/1527 and https://stackoverflow.com/a/18730680/1527 you're sort of asking what the difference between a portrait and a watercolour is. – Pete Kirkham May 29 '20 at 16:33
  • This gives some insight into separate behaviors but if the context of the domain model depends if an activity diagram is used or not. How is this context of the domain model defined? In this theory, it should have a name. This is what I try to figure out since the domain model is a term where it's shaping depends on its context. – Jens Ingels May 29 '20 at 17:03
  • https://en.wikipedia.org/wiki/Domain_model – qwerty_so May 30 '20 at 16:13

2 Answers2

1

Domain model and domain diagram do not exist in UML, so all depends on the definition you use.

If I look at the literature it seems the 'standard' diagram to show a domain model is a class diagram, may be associated with object diagram to show example of instances.

An activity is a behavior, to use common word an 'algorithm'. An activity can be used to model the body of an operation. The goal of an activity and a class are totally different, one cannot replace the other.

Even the definition in Wikipedia is a domain model is a conceptual model of the domain that incorporates both behaviour and data the associated diagram in the article is a class diagram. In the article the word behaviour visibly refer to the rules the business uses in relation to that data.

Anyway, whatever, all depends on what you have to model, there is no definitive rules saying in case 1 use only class diagram, in case 2 use only activity diagram, and so on. You use all the diagrams you want while they are adapted for to say something useful

bruno
  • 32,421
  • 7
  • 25
  • 37
  • Hm, how does an activity diagram interacts with use cases if its main intension is the algorithm. In my classes, Activity Diagrams were used to support a use case but as representation of the object model. So does this mean that teacher his view of its use was flawed or the visual paradigm provides those limitations for flaws to happen? – Jens Ingels May 29 '20 at 17:00
  • @JensIngels Each kind of elements in UML allows to model a given 'view'. When you speak about the *structure* (data) you use class, object, component etc. When you speak about *behavior* you use activity, state machine, use case, interaction etc. *But* UML is a language, not a method/process, the way you use UML is not part of UML. To say *an activity diagram interacts with use cases* can be true and false at the same time, I mean activity are not *only* dedicated to that. Elements can be used at any level to model *what* to do up to *how* to implement and deploy on machine/network/... – bruno May 29 '20 at 17:34
  • A diagram never interacts with anything. Classes collaborate and their interaction is pictured in ADs (or SDs). UCs are realized by collaborations and the latter are documented with ADs (or SDs). – qwerty_so May 29 '20 at 20:22
  • @JensIngels you did not accepted my answer, is it useful for you or I delete it ? – bruno Jun 01 '20 at 21:40
0

Activity diagrams are used for represent the behavior which shows flow of control or object flow with emphasis on the sequence and conditions of the flow.

Example: activity diagram

The class diagram is used to specify the relations that exist between the classes from your model, also you can represent their attributes and methods.

Example: class diagram

Going back to your question, if you want to represent the behavior of your model, I should recommend using an activity diagram, but if you only want to specify classes that you want to use and their relation then you can use a class diagram. 

Community
  • 1
  • 1
Ivan M
  • 1