문제

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.

도움이 되었습니까?

해결책

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

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top