A protocol defines the set of incoming and outgoing signals for a non-conjugate port. If the port is made conjugate, than the port will send the protocols incoming signals, and will receive the incoming signals. Protocols define the valid types of messages that can be exchanged between the participants in the message.
Protocols represent a collaboration object that contains two roles that are connected to one another. Each role is typed to an interface that represents the Base and Conjugate roles respectively. The Collaboration relationship realizes the Base Interface and has a dependency usage relationship to the Conjugate interface. This allows a port that is typed to the Protocol Collaboration to understand the required and provided interfaces explicitly.
Protocols are binary, involving just two participants. In the binary protocols only one role, called the base role, needs to be specified when defining the protocol. The other side of the communication pattern, called the conjugate, can be derived from the base role by inverting the incoming and outgoing message sets. The inversion operation is known as conjugation.
The following represents an example of a protocol collaboration, and relationships
to protocol role interfaces:
Protocols are primarily used to identify the type of a port. Ports play the role of one participant in a communication relationship. Ports are typed to the protocol (collaboration), not the role (interface).
Protocol signals are events. Protocol events are Call Events. Each event defined in a protocol is generated as an operation with the same name as the event in the generated protocol class. The return value of the operation dictates the actions that can be performed with the event. Incoming events RTInSignal and outgoing events RTOutSignal differ in the allowed actions.
The protocol container is simply a Package that allows for encapsulation of all the different elements that together make up the collaboration that defines the protocol. The intent is that this package is self-sustaining and doesn’t have any outside dependencies allowing it to be exported or moved without any loss of functionality.