Optional function parameter indication in UML Sequence Diagram

Viewed 2097

Is there any formal way to signal that a function parameter is optional?

For example, in this image:in this image

I want to inform that the nodes_clicked parameter could be populated or left empty.

Thanks.

2 Answers

Optional parameters are nothing handled in UML as it's jus "syntactic sugar" compilers implement to make coders happy. You can mimic that in a SD with a note attached to the message. However, I just would not go to that detail and leave it to the coder (they aren't children you have to tell each single step to take).

Sequence diagrams represent sequence of function calls. Each messages calls functions with their parameters and the values of these parameters. So you can not model the fact that a parameter can have a value or another...

Related