How to use Java Development Kit (JDK) classes in your class diagrams

tomcat-thumbJava Development Kit (JDK) is a platform for developing Java applications. It provides the runtime for running Java applications, as well as the tools that needed for develop, compile as well as debug Java programs. JDK provides a large library that ease the development of the software. During design time you may want to present the JDK classes which used in your model. You probably need to re-create them manually before using it. In this article we will show you how you can reverse engineer JDK’s library into class model using Visual Paradigm, and use them in your class diagrams.

This article split into 2 phrases. The first phrase we will generate class models for JDK in an independent project, and in the second phrase we will use the JDK classes in the independent project in your class diagram by creating project reference to it.

To generate the class models for JDK

  1. Create a brand new project, name is as JDK Library.vpp

    Create new project to host JDK classes

    Create new project to host JDK classes

  2. Go to Tools > Code > Instant Reverse...

    Select Instant Reverse

    Select Instant Reverse

  3. Select Java as the Language.

    Select Java in Instant Reverse dialog

    Select Java in Instant Reverse dialog

  4. Select Add Zip, then specify the path to the src.zip which bundled inside JDK in file chooser.

    Add src.zip from JDK for Instant Reverse

    Add src.zip from JDK for Instant Reverse

  5. Make sure Reverse source on demand is selected, then press OK.

    Select Reverse on demand

    Select Reverse on demand

  6. The Class Repository tree will show automatically. Now go to Class Repository tree and expend the Instant Reverse tree node.
  7. Right click on the src.zip, and select Reverse “src.zip” to Class Repository.

    Reverse JDK Classes to Class Repository

    Reverse JDK Classes to Class Repository

  8. After that the classes of JDK will be reversed into the project.

    JDK Classes reversed to Class Repository

    JDK Classes reversed to Class Repository

  9. Save your project and now it is ready to use in your own class model.

    Save project

    Save project

To use the JDK classes you reversed

  1. On your project which need to use JDK classes, go to Project > Reference Project…

    Open manage Reference Projects dialog

    Open manage Reference Projects dialog

  2. Press Add button, then locate the JDK Library.vpp you created in the previous steps.

    Add JDK Library.vpp as reference project

    Add JDK Library.vpp as reference project

  3. Once the JDK project is added, press Close to proceed.

    Close Manage Reference Project dialog

    Close Manage Reference Project dialog

  4. After that you will able to use the JDK classes as the attribute type. You can also drag & drop those JDK classes from Model Explorer into your diagrams for visual modeling.

    Use JDK Classes as datatype

    Use JDK Classes as datatype

You can download the project file which contain all classes reversed from JDK7 at the link below.

Download Visual Paradigm Project File for JDK7 Class Models

Related Know-how

Related Links

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply