Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Operational examples of Netbeans UML modeling

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article shares with you the content of operational examples of Netbeans UML modeling. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

The operation of Netbeans UML modeling

UML (Unified Modeling Language), the unified modeling language. Is a language used to visually model software-intensive systems. UML is an open way to illustrate, visualize, build, and write an object-oriented software-intensive system artifact during the development phase. The application of * * is engineering practice, and it has been proved to be effective in modeling large-scale and complex systems, especially at the software architecture level.

Many programmers never find time to model the project before they start coding, while others never think about creating a model for the system before coding the system. In fact, modeling is a very important process, you abstract things in your brain into several views, easy for yourself to understand and review, but also easy for you to communicate with your colleagues. Just imagine, if you hand over your software engineering project to your successor and just give him a lot of code, how should your successor figure out the module relationship and so on. If you have a clear modeling, then all the work will be much easier.

A model is a collection of model elements and their relationships that can be grouped to make up a diagram. These diagrams are better than the sum of the elements because they provide various views of your model. Different views can be used to describe how the application is built. The type of diagram used to visualize the model depends on what your problem is. There are three main models in UML system development:

Functional model: shows the functions of the system from the user's point of view, including use case diagrams.

Object model: the use of objects, attributes, operations, associations and other concepts to show the structure and foundation of the system, including class diagrams.

Dynamic model: show the internal behavior of the system. Including sequence diagram, activity diagram, state diagram.

To use the Netbeans UML model, you need to start with the next UML plug-in, download the plug-in by the tool-- "plug-in, and download the UML plug-in."

Here is an example of how to use NetbeansIDE's UML modeling capabilities to create a simple UML class diagram. Then, use code generation to develop a simple personnel management application for a university.

1. First create a Java application project, project name: myjava, and clear the check box marks for "set Master Project" and "create main Class". Click finish.

two。 Create a UML project and select Java platform Model. In the Project name field, type myuml. Select Class Diagram in the Diagram Type list. The name of the graph is: collegeuml. Click finish.

3. From the basic category of the modeling component panel, select the Class icon and drag to the center.

4. Select the newly added class element and type Employee. Enter

5. Select the Employee class element, right-click, create the attribute, type "EID", and the class diagram will automatically create the get and set methods for changing the attribute. Right-click again, create the operation, and enter "public double calcSalary ()"

6. From the basic category of the modeling component panel, select the package icon, drag it to the center, and with the package element selected, type Collegepack.

7. From the basic category of the modeling component panel, select the Interface icon, drag to the center, with the interface element selected, type CollegePerson, and then press enter. Add: public void getSchedule () to this interface.

8. Add a "class" icon, named "Professor", as a subclass of Employee.

9. Select the Employee element, select the implementation icon to point to the CollegePerson interface, and the implementation link indicates the relationship between the class and the interface. Select the Professor element, select the generalization icon, point to Employee, the Select method to redefine dialog box is displayed, and select the calcSalary method. A generic link shows the relationship between a subclass and its superclass. Subclasses are refinements of superclasses, indicating that they can inherit the properties (attributes and operations) of superclasses.

10. Select the package element Collegepack, select the "containment" icon, and point to all other elements. Containment links show how elements are divided into groups. In this example, we divide all the class elements into a group in the Collegepack package.

11. Generate Java code: in the Project window, right-click the myuml node and select generate Code from the pop-up menu. The generate Code dialog box is displayed, and then specify Target Project. Receive the default check box in the generate Code dialog box, and click OK. IDE generates the code and displays the progress of the code generation in the output window.

Summary of Netbeans UML modeling:

In this case, we designed a class diagram for a simple university personnel management program. We have learned how to perform the following tasks:

◆ creates a UML project

◆ uses the UML icon in the modeling component panel to create classes, interfaces, packages, properties, and operations

◆ uses UML associations to link classes together

◆ views the elements created in the diagram editor in the UML project displayed in the Project window

◆ generates the source code for the elements created in the diagram editor in the UML project and views the code in the source code editor

The following figure is an example of a class diagram created with Netbeans:

Thank you for reading! On "Netbeans UML modeling operation examples" this article is shared here, I hope the above content can be of some help to you, so that you can learn more knowledge, if you think the article is good, you can share it out for more people to see it!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report