Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to represent lambdas in UML class diagram?

Is it OK to simply add lambdas to the operations list on the class diagram as normal methods, and give them a name?

like image 710
Csaba Fityó Avatar asked Sep 09 '25 14:09

Csaba Fityó


1 Answers

Yes, sure. A lambda is no different to any other operation, except that you don't need a name for it. You can say that it's syntactical sugar that the language can add to your code cake. Since the function behind it can be described, this description can also be summarized with a header (what you normally do with operations). You could also simply stereotype it with <<lambda>> if that makes sense in your modeling environment.

like image 73
qwerty_so Avatar answered Sep 12 '25 04:09

qwerty_so