Global objects in Kotlin

During our design review, our reviewer said that even for global entities, we have to show construction in the sequence diagram.

However, what we wanted to use were Kotlin Object declarations, like here: Object declarations and expressions | Kotlin Documentation

These do not have a constructor, and are instead constructed by Kotlin automatically.

Do we still need to model that somehow?

2 Likes

There may have been a misunderstanding. It is correct that global objects in Kotlin are created automatically, however, you still have to initialize them, like setting the fields if you have any, which should be shown in the sequence diagram.

1 Like