user13948
user13948

Reputation: 453

UML class diagrams main class

In no examples online have I seen the main method included in class diagrams. If it should be there, how do I represent it? Is it just like any other method, preceded by + to denote public and underlined to show it's static? If main methods don't get included, why not?

Upvotes: 6

Views: 24724

Answers (2)

Geert Bellekens
Geert Bellekens

Reputation: 13701

Yes, the Main() can be modeled as a public static operation, just like any other operation.

Whether or not you find it interesting to model depends on your viewpoint. If you wish to model the behavioral details and sequences of messages when running your application, then yes, it might be very useful.

If you are only interested in a structural "entity" class view, then the main class might not be that interesting.

Upvotes: 4

reos
reos

Reputation: 8324

The main method is only use for init your application, it is not part of you application model. I think it should not be included in the UML diagram. It's the same as application servers you don't include the applicartion server classes in your Diagrams.

Upvotes: 4

Related Questions