1. OOM Introduction
Object-OrientedModel (OOM) object-oriented model. An OOM contains a series of packages, classes, interfaces, and their relationships. These objects form a class structure of all (or part) the logic of a software system design view. An OOM is essentially a static conceptual model of a software system.
(1) use UML to describe the system structure
(2) generate source files (such as Java, C #, and PowerBuilder) in different languages using class diagrams, or convert source files of different types into corresponding class diagrams using reverse engineering.
1.1 create OOM
(1) Select File> New Model Menu item
(2) Select "Object-Oriented Model" (object-oriented Model) in "Model type" on the left)
(3) enter the model name on the right and select the language.
(4) Select a type
1.2 design example Diagram
(1) define Use Cases
(2) Define roles
(3) define Association
1.3 design sequence diagram
(1) Define roles
(2) define an object
(3) define a message
(4) define the activation period
1.4 design class diagram
(1) define a class
(2) define attributes
(3) define the identifier
(4) define operations
(5) define interfaces
(6) create a contact
1) join
2) Dependency
3) Generalization
4) Implementation
1.5 generate code
(1) Select Language → Generate Java Code
(2) Select a class
(3) set generation options
(4) generate code
(5) view the generated code
Ii. Example 2.1 create OOM
File --> new model
Here we select the OOM type to use the default Class digoal, and the language is Java.
2.2 OOM generates Java code
Create a class through the tool Panel, such:
Double-click a class to edit related attributes.
Add variables to the class:
If we want to add a method to the class:
First, write the method name and return type of the method, and then click the second step to modify the corresponding attributes of the method:
Content of the modification method:
The method name cannot be modified. In this step, we can only modify the code corresponding to the method.
To add parameters to a method:
After the configuration is complete: