D. Rattansingh
D. Rattansingh

Reputation: 1669

Showing a recursive method with UML

Is there a way to show a recursive method with UML class diagram modelling?

class diagram

In the above class I have a static method Calculate and I want to show that this method alone calls itself recursively and not any other methods or the class. How do I show this in UML?

Upvotes: 1

Views: 755

Answers (2)

Wolfgang Fahl
Wolfgang Fahl

Reputation: 15594

You could use a stereotype "recursively" or add a tagged value "recursive=true" to add that information.

Upvotes: 0

gefei
gefei

Reputation: 19856

In sequence diagrams you can show method calls made by a method, it is therefore possible to show a method is recursive (caling itself). A class diagram, on the contrary, models only the static structure of the system. If you want to emphasize a method is recursive, the only way is to use a comment

Upvotes: 3

Related Questions