Capsules in capsule-based UML models

Capsules are the fundamental element for modeling capsule-based systems. Capsules represent the independent flows of control in the system, and enable you to design systems that can handle many simultaneous activities.

Capsules are highly encapsulated and communicate through special message-based interfaces called ports. This structure means that each capsule's internal implementation is hidden from the environment, which makes capsules highly reusable.

When a capsule receives a message from another capsule, a signal event is generated and the system typically requires a response from the capsule. This response often involves performing calculations, formulating a response, and sending one or more messages. The optional state machine that is associated with the capsule represents the capsule's behavior. The state machine controls the operation of the capsule and is the only element that can access the protected parts of the capsule.

The advantage of message-based interfaces is that a capsule has no knowledge of its environment outside the interfaces, so it is more flexible and robust than regular objects.


Feedback