What is the appropriate way to model API requests in sequence diagrams?

I'm going to create some sequence diagrams to model interactions in a web API.

There is a duplicate request / response pattern that I'm not sure how to simulate.

Let's say I have an API request to request attributes from an API endpoint. Would it be advisable to use a standard response template like this? Good style for assigning multiple return value variables ( encrypted_attributes, hashes

)?

Standard Reply Pattern

Or custom queries / responses so whether to create an image that both request_attributest

and return_encrypted_attributes

are performed independent of each other entities?

Custom Request / Repsonse Pattern

+3


source to share


1 answer


Answers to what is appropriate or what is good style can only be opinion based. I don't have a strong opinion on this, but I see some solutions:

1) Sparx Systems Enterprise Architect can draw synchronous messages with an "implicit response message" as shown here: http://www.sparxsystems.com/resources/uml2_tutorial/uml2_sequencediagram.html

Only 1 line (not 2 lines). Simple diagram, easier to read.



2) Google: "UML Sequence Diagram Best Practices" returns multiple assets with pros / cons.

3) Usually, when a solution like this is needed, following the path of least resistance (only 1 mile), also known as the KISS principle , is a good guide .

+3


source







All Articles