How to model two interacting state machines of two different classes?

As far as I know, UML state machines model the behavior of a single element, such as the behavior of a single class.

I wonder how to model state machines with two classes that interact.

The state of one class depends on the state of another class, and the transition of one finite machine can initiate the transition of another state machine.

Should I use the UML effect? Could the UML effect of one state machine trigger the transition of another state machine?

+3


source to share


1 answer


You can dispatch events between classes to trigger transitions, for example:

enter image description here




enter image description here

+2


source







All Articles