Question

Can anybody please suggest do i have to or can i represent main method (of course static) in class diagram. I have this class (standalone code) which has everything done in main method. No class variables, no other methods and no other classes. I have already refactored the code to break in 5 different classes and already made class diagram for them. But part of my assignment requires to make a class diagram for the unrefactored code too. Please suggest.

Was it helpful?

Solution

I include it in my case because this is the function which initiates the application. It is not different than other functions.

OTHER TIPS

IMHO it actually doesn't matter.

As long you are not generating interaction diagrams or any sort of execution out of this, having main in a diagram does not add any value except quick navigation to the main entry point (if possible).

The class containing the main should typically be (mostly...) empty containing only the main.

I tend to not have every detail in such diagrams since displaying a whole architecture on class level is rarely a good idea anyway. And main would be such a detail.

However this is only my point of view.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top