2
votes

Considering the following class diagram:

enter image description here

The class System is active and its behaviour is to continuously

  • call filter on PressureSensorFilter passing PressureSensor.Pressure as argument
  • call Display.show passing the output param of PressureSensorFilter.filter as argument

I would like to model the behaviour of System through an ActivityDiagram.

The main challenge in doing this is accessing the property PressureSensor of System. After reading the UML 2.5 specification, I believe that the only way to do this is to use ReadSelfAction(pag 457 UML 2.5 spec) and ReadStructuralFeatureAction (pag 466 UML 2.5 spec) as depicted by the following Activity diagram:

enter image description here

where

  • ReadSelfAction gives as output a current Instance of System.
  • ReadPressureSensorFe.. is a REadStructuralFeatureAction that reads the property PressureSensor of the object give at its input pin which in this case is the current Instance of System.
  • CallBesselFilter.filter Action and CallDisplay.show Action are two CallOperationAction(s) that call PressureSensorFilter.filter and Display.show respectively.

The issue with this is that is very convoluted and unclear. Is there any less convoluted and more clear way to describe the behaviour of System through an Activity diagram?

2

2 Answers

0
votes

The ReadSelfAction as extra action is superfluous. You can reduce the control flow like this:

enter image description here

The pressure is read by the filter from the Pressure class' property. The filtered output is sent to Display and looping....

You should look into SysML. It's designed to cope with exactly that kind of problems you deal with.

0
votes

It all depends on what detail you would like to provide in your activity diagram. The diagram you provide is correct. By the way, its level of details could be directly used to generate code. If you would like to describe behavior more abstract, do not use actions like read structural feature etc. But in your example, it is very good and precised way of description.