Reply To: How to use the component_ref base type?

homepage Forums BridgePoint/xtUML Usage and Training How to use the component_ref base type? Reply To: How to use the component_ref base type?

#5256
John Wolfe
Participant

Domi:

You may recall that we used this capability on the DIAMETER project. The model in question had a single server component sprouting a provided interface which was then connected to three different client components, each sprouting a required interface connected to the same provided interface on the server component.
The server component contained at least one class (call it Request) with an attribute (call it Requester_ID) of type component_ref. When the server received a request from a client, it would create an instance of Request and set the value of Requester_ID to the value of the ‘sender’ keyword. Later, when the server needed to reply to a client, it would then use the value of Request.Requester_ID as the target in a ‘send’ statement, enabling the server to send interface messages through a single port to a specific component instance among several connected to that port.
To summarize, the data type in question (component_ref) should be used carefully, and only in situations in which you anticipate the need to connect multiple component instances to a single port and require the ability to direct interface message to a specific component instance connected to that port.

–JRW