Quantcast
Channel: java code – Visual Paradigm Know-how
Viewing all articles
Browse latest Browse all 5

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

$
0
0

Java 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 for UML, 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 Engineering > Instant Reverse > Java.

    Select Java Instant Reverse

    Select Java Instant Reverse

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

    Add src.zip in JDK for Instant Reverse

    Add src.zip in JDK for Instant Reverse

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

    Select Reverse on demand

    Select Reverse on demand

  5. Now go to Class Repository tree and expend the Instant Reverse tree node.
  6. 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

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

    JDK Classes reversed to Class Repository

    JDK Classes reversed to Class Repository

  8. 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. Right click on the blank area of the Model Explorer, and select Manage Reference Project…

    Manage Reference Projects

    Manage Reference Projects

  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 see the JDK classes showing in Model Explorer.

    JDK Classes showing in current project

    JDK Classes showing in current project

You can then use them by drag & drop into our diagram, or select it as the datatype of your model.

Drag & Drop JDK classes from reference project to curent project

Drag & Drop JDK classes from reference project to curent project

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


Viewing all articles
Browse latest Browse all 5

Trending Articles