开发者

What UML Diagram should I use to represent socket conversation?

开发者 https://www.devze.com 2023-03-12 18:09 出处:网络
What UML Diagram should be used to开发者_如何学编程 represent Socket Conversation ?Sequence diagram. But you can also look at Communication diagram and Timing diagram.Any one of the interaction diagra

What UML Diagram should be used to开发者_如何学编程 represent Socket Conversation ?


Sequence diagram. But you can also look at Communication diagram and Timing diagram.


Any one of the interaction diagrams. I use the sequence diagram most often.


I would use composite structured diagrams to show two classifiers are connected by means of ports. I would therefore stereotype those ports with an ad-hoc stereotype adding attributes related to the IP, transport portocol (TCP vs UDP) and port. I would the MARTE profile (specifically the GCM package) to also stereotype those ports as ClientServerPorts. I would therefore define an Interface, stereotyped as MARTE::GCM::ClientServerSpecification representing the protocol. To this end you have to choose one point of view. This means that if a message msg is sent from the active object A to the active object B then you have to choose whether the ClientServerSpecification is defined from the A point of view (msg is sent) or B point of view (msg is received). Then for each message I would create a Signal (with attributes representing the message fields) and add to the Interface representing the protocol (ClientServerSpecification) a UML::Reception associated to that signal (see the UML::Recetion's signal attribute). Then, as specified by the MARTE profile, I would stereotype that reception as ClientServerFeature and put it as provided (if the active object to which the Interface relates is supposed to receive the associated message) or required (if the active object is supposed to send the message). I would then define an number Interactions (i.e. a sequence diagram) showing the possible exchanges of message between A and B (asynch message).

0

精彩评论

暂无评论...
验证码 换一张
取 消