Forward and reverse engineering of Rational Rose class diagram and code

Source: Internet
Author: User

A forward project (in Java, for example)

1 Setting the default language to Java

Tools, Options->notation->dafault: Choosing Java

2 Set the directory location where the forward engineering generated Java files are saved (typically specified as the SRC directory of the project)

ClassPath, Project specification, Tools, JAVA/J2EE, click New to select the path: Figure


3 Open a well-designed class diagram, select the class of Java files you want to generate, and you can choose multiple options (hold down the CTRL key or the Mouse wide box)

4 Generating Java files

General Code, Tools-JAVA/J2EE

5 complete

Precautions:

1 Avoid the generated Java classes that contain rose other information:

Project specification, Tools-JAVA/J2EE, go to Generate Rose Id, Generate Default Return line off selected state

2 adding the Gettter (), setter () method of each attribute to a class

Select the class of Java files you want to generate-right-click, select Open Stantard Specification-----Operations----Select the first line (that is, to set the ID property) Double-click

---> select java---> Propertytpe, drop-down select simple, complete the settings for the id attribute gettter (), Setter () method, as shown in figure

Again, in turn, set other properties name, Addre_mail

Note: Personal recommendations do not use this feature, you can complete the gettter (), Setter () method, and the constructor of related parameters for each property through the Eclipse tool

3 Inter-class call relationship design

General Class A calls Class B, which can be achieved by assigning a value to Role A in association spencification. As shown in figure:



Attached: useful small function settings

Format---Layout Diagram, you can neatly lay out all the classes


2: Reverse generation of UML design classes

Click tools-> java/j2ee-> Reverse Engineer to bring up the Java Reverse Engineer dialog box. As shown in figure:


Add the Java file you want to reverse engineer on this page and select it, then click the Reverse button to


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.