How can I pass a class structure as a message in a sequence diagram?

0 votes
asked Oct 15, 2021 in Question / help by anonymous
I want to pass a message with fields and thought I could use a class object for the same, something along the lines of:

Class foo

A -> B: $foo

1 Answer

0 votes
answered Oct 20, 2021 by Martin (8,360 points)
edited Oct 20, 2021 by Martin

Yes, to my surprise, you can do that - by putting a 'subdiagram' in the message text.

It is a little clunky because sequence diagrams only support multiline using \n, it would be nice to have the ":text;" alternative that other diagrams have recently been given (eg).

I've thrown in some alternatives too :- a creole table, JSON, YAML

(click diagram for online server)

commented Oct 20, 2021 by anonymous
Thanks a lot. A little clunky, but it does the job I was looking for.
commented Oct 20, 2021 by The-Lu (64,300 points)

Hello all,

For:

It would be nice to have the ":text;" alternative that other diagrams have recently been given (eg).

Here is the feature request:

Regards,
Th.

commented Oct 20, 2021 by Martin (8,360 points)

Here's an idea of using a macro to help declutter:

(click to view)

...