SinelaboreRT Header Logo

SinelaboreRT

Productivity for embedded software development

User Tools

Site Tools


wiki:toolbox:regions_or_no_regions

Regions or no regions

For some systems you want to model certain parts which run independently from each other but react on the same set of events. These independent parts can be modelled using regions in UML state diagrams. Another term often used are orthogonal states or AND states (model is in state A and state B at the same time). Microwave oven model with hierarchical states

Let's take a microwave oven as an example. The model above is designed around the states that can be perceived from the outside (i.e. the user). Either the oven is on or off or paused. All other elements in the oven (lamp, timer …) are handled in these states and the transitions between them.

Benefits:

  • compact diagram
  • Eventually easier to understand for an outsider (e.g. customer) not knowing or interested in the internal organisation of the device.

Drawbacks:

  • the individual parts of the system are not represented and separated clearly

Model with regions

Introducing regions separates the parallel running parts of a system in an own region of the model. A region has a name and should focus on one part of the system. A state can contain two or more regions which are executed in parallel. Each region receives the same events that are sent to the containing state. Entering a state with regions enters all regions at the same time. Leaving a state with regions leaves all regions at the same time.

Microwave oven model using regions

Benefits:

  • Clear separation of parallel running parts of the system
  • Reuse is simpler because different parts of the system are not mixed with each other.

Drawbacks:

  • Slightly bigger model and more states to model

Conclusions

Both models creates the same output. So it is not about right or wrong but more what is more appropriate for the current case. If reuse is a design goal regions can have a benefit. If a most compact design is a design goal regions have a slight drawback.

Send us a mail in case you want receive the model and test bench to get an own impression.

This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
You could leave a comment if you were logged in.
wiki/toolbox/regions_or_no_regions.txt · Last modified: 2021/04/18 15:55 by pmueller

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki