Professional Documents
Culture Documents
Version 2001A.04.00
Developing Real-time Software With Rational Rose RealTime, v2001A.04.00 Copyright 2001 Rational Software, all rights reserved
Developing Real-time Software With Rational Rose RealTime, v2001A.04.00 Copyright 2001 Rational Software, all rights reserved
Capsule Interfaces
A capsules interface is completely defined by its ports.
Ports
Developing Real-time Software With Rational Rose RealTime, v2001A.04.00 Copyright 2001 Rational Software, all rights reserved
Developing Real-time Software With Rational Rose RealTime, v2001A.04.00 Copyright 2001 Rational Software, all rights reserved
Ports
Capsules communicate by sending and receiving messages through ports A port can only send and receive specific sets of messages Defined by a protocol class
Stimulus message
Developing Real-time Software With Rational Rose RealTime, v2001A.04.00 Copyright 2001 Rational Software, all rights reserved
Response messages
Ports (cont.)
Ports are interface elements between a capsules structure and behavior Ports have a composition relationship with the capsule they serve
Ports are created and destroyed along with the capsule that owns them
Developing Real-time Software With Rational Rose RealTime, v2001A.04.00 Copyright 2001 Rational Software, all rights reserved
Developing Real-time Software With Rational Rose RealTime, v2001A.04.00 Copyright 2001 Rational Software, all rights reserved
End Port
Protected port
Developing Real-time Software With Rational Rose RealTime, v2001A.04.00 Copyright 2001 Rational Software, all rights reserved
Protocol Class
Specifies which messages can be sent to and received from a port A message is defined by a named signal and any optional data
<<Protocol>> DeviceControl isOn (void) isOff (void) turnOn (void) turnOff (void)
Protocol Class
Developing Real-time Software With Rational Rose RealTime, v2001A.04.00 Copyright 2001 Rational Software, all rights reserved
Operator
ringBack
connected time
Developing Real-time Software With Rational Rose RealTime, v2001A.04.00 Copyright 2001 Rational Software, all rights reserved
Protocol Roles
A protocol class specifies the communication patterns between capsules, viewed from either end of the connection. The protocol role represents only a single view (base or conjugate), specifying which messages can be sent to and received by that specific port type The protocol role of the port determines which signals are incoming and outgoing Two ports must realize compatible protocols to permit a connector to be established between them
Developing Real-time Software With Rational Rose RealTime, v2001A.04.00 Copyright 2001 Rational Software, all rights reserved
caller
operator
Defining Protocols
Protocols capture the interactions related to each role a capsule plays in its collaborations Capsules that play similar roles may reuse protocol definitions Protocols should not be overloaded and should have a clear purpose:
Capture a complete message dialog between collaborating capsules
Developing Real-time Software With Rational Rose RealTime, v2001A.04.00 Copyright 2001 Rational Software, all rights reserved
Developing Real-time Software With Rational Rose RealTime, v2001A.04.00 Copyright 2001 Rational Software, all rights reserved
Capsule Structure
Capsules contain component elements:
Subcapsules Passive classes Ports Connectors
Developing Real-time Software With Rational Rose RealTime, v2001A.04.00 Copyright 2001 Rational Software, all rights reserved
Structure Diagram
A specialized form of the collaboration diagram Specifies the capsule's interface and its internal composition
Ports Connector
Capsule Subcapsule
Developing Real-time Software With Rational Rose RealTime, v2001A.04.00 Copyright 2001 Rational Software, all rights reserved
Connectors
Objects that show key communication relationships between capsules
Connect ports that play complementary roles in the protocol they are associated with Can connect ports associated with different protocols if the ports are conjugate and the protocols have compatible in- and out-signals.
Connector
Developing Real-time Software With Rational Rose RealTime, v2001A.04.00 Copyright 2001 Rational Software, all rights reserved
Developing Real-time Software With Rational Rose RealTime, v2001A.04.00 Copyright 2001 Rational Software, all rights reserved
Structure Diagram
/ client <<Protocol>> Link response (void) command (void) / server
+ / link~ <<Port>>
Developing Real-time Software With Rational Rose RealTime, v2001A.04.00 Copyright 2001 Rational Software, all rights reserved
Developing Real-time Software With Rational Rose RealTime, v2001A.04.00 Copyright 2001 Rational Software, all rights reserved
Draining Empty
Time
Developing Real-time Software With Rational Rose RealTime, v2001A.04.00 Copyright 2001 Rational Software, all rights reserved
Developing Real-time Software With Rational Rose RealTime, v2001A.04.00 Copyright 2001 Rational Software, all rights reserved