How should I represent the main method (java) using UML?

眉间皱痕 提交于 2019-12-10 18:37:48

问题


I have three classes: Bridge, Main and Car. I have no idea about how to include the main method in my UML representation. Should I list all the attributes...as well as the main method?

The main method does: - a bit of calculation - instantiate the other two classes

I would draw the Main, this way:

---------------------------
Main
---------------------------

---------------------------
+ main(String[] args): void

---------------------------

Is that correct? Thanks


回答1:


Your drawing is good, you just need to underline the main method to show that it is static. I think that you should model it since it shows that this class is one entry point to the system (there may be more).




回答2:


you don't need to include main method in your UML and also as I remember, you should put all the members and methods that are present in your class except the main method. Since the main method is somewhat a given already



来源:https://stackoverflow.com/questions/11280301/how-should-i-represent-the-main-method-java-using-uml

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!