简体   繁体   中英

Java UML diagrams and built-in classes

I'm in the process of designing a project which utilizes awt and swing package to create the user interface. Specifically ill be using the JFrame and JComponent as well as Graphics and Graphics2D.

My questions are:

  1. Do I need to include the JFrame class when JFrame will only be an instance in my user interface class?

  2. I'm inheriting JComponent and overriding the draw() method in my interface component class. Do I also need to include the JComponent class in my UML?

I've seen some feedback on similar questions saying that it depends on the audience. In my case, my audience is my university prof. Any input helps, thanks!

As you already found out, it still depends (and I don't know your professor). Alas, you can simply add external classes just with their name to your model. So you don't need to show their properties/operations. Leaving them completely out would most likely make the model less useful as one needs to know about the external relations.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM