Rational Rose 2003 Reverse Engineering convert C + + source code into UML class diagram

Source: Internet
Author: User

Online about from C + + code to UML class diagram generation process of things, found a usable, and now turn down, in case of a rainy days.

Turn to slightly adjust the next content, only care about the use.

Original source http://siulyn.blog.163.com/blog/static/6245583620087252539344


Rational Rose 2003 Reverse engineering generating UML Model diagram

This section focuses on how users can use Rose's reverse engineering to generate UML models for structural analysis of C + + code.

Rational Rose supports model-to-code conversion and reverse engineering of standard C + + and Visual C + +. The following is a detailed explanation of the reverse engineering steps and specific actions for both C + + project.

1 ANSI C + + (standard C + +) Reverse engineering (Reverse Engineer)

Using standard C + + reverse engineering, you need to create a component (component) in the Component Diagram (component view) that sets up the information for the component that needs to be transformed, that is, the language of the component, the files it contains, the path to the file, the file suffix, and so on. Then reverse engineer can convert the code into a class diagram based on the given information.

(a) right click on the component view (Component view), select New->component, create a new component

(ii) Set the Language property of component to ANSI C + +

A) Select the created component, right click and select Open Specification

b) In this dialog box, set the language of the component to ANSI C + +

(iii) Configure the ANSI C + + component, set up the C + + code files contained in the component, and make detailed settings for the C + + language

A) Select the component, right-click, select ANSI C++->open ANSI C + + specification

b) Set source file root directory as the path to your C + + source file, enter the name of the converted project in Reverse Engineering root package, and default to C + + Reverse Engin The Eered,reverse engineer directories as packages option will generate the same document structure as the source file in Rose's logical view in the form of a folder. Clicking Add Files adds the file that needs to be converted to project files, depending on your needs, such as the header file extension, and so on.

(iv) converting the set-up component into a model diagram

A) Select the Set component, right-click, select ANSI C++->reverse Engineer

b) Select the class you want to convert, click OK, and a component reverse conversion is complete.

c) After the reverse conversion is complete, the reverse-converted code is displayed under the logical view of the Rose main interface.

(v) Model drawings for reverse engineering

A) Create a new class Diagram and name it.

b) Double click on this diagram to open, select Query->add Classes.

c) Select the folder containing the class in the Package drop-down list and click OK. Select All >> Add.

d) Repeat the same operation until all classes that need to be converted into UML models have been added. Finally, all the generated UML model diagrams and their connections are displayed in the Class Diagram view.

(vi) Arranging views

Generally speaking, a system involves a lot of data elements, resulting in a very crowded view, typesetting is very difficult. The automatic typesetting features provided by Rational Rose can easily help users to solve this problem.

Choosing Format->layout Diagram, the system rearranges all the elements in the diagram in an optimal way, giving the user a clear view.



2 Visual C + + Reverse Engineering (Reverse Engineer)

Visual C + + uses this feature to require that visual Studio be installed on the user's machine at the same time. The reverse engineering of Visual C + + also requires that you first create a component and set the Language property of the component to VC + +. Rational rose to the VC + + model conversion is by reading VC + + project file information to achieve, the user only need to assign the corresponding project file information to the component can be. The remainder is essentially the same as "ANSI C + + (standard C + +) reverse engineering ."

(a) the VC + + project information is assigned to the newly created component.

A) Select the component, right-click, select Assign to Project

b) In the dialog box, locate the component you just created, right-click and select Properties.

c) In the following dialog box, select the project you want to convert, click OK, and the component is associated with project that needs to be converted.



(ii) Conversion of the set-up component into a model diagram

Check the set component, right click, Update Model ..., will pop up the confirmation dialog box, select the class to be converted, click Finish.

Comments

①IBM Rational Software Architect is an integrated design and development tool that enables users to develop clearly structured applications and services in a UML model-driven development approach.

②IBM Rational Software Modeler is a UML2.0-based, customizable visual modeling and design tool that follows the workflow provided by System designers, system analysts, designers, and more, to communicate and design more effectively.

③UML provides various types of model description diagrams

Use case Diagram: Describes a functional unit provided by the system, primarily to help the development team understand the functional requirements of the system in a visual way, including "roles" based on the basic process (actors, other entities interacting with the system), And the relationship between use cases within the system.

Sequence diagram (Sequence Diagram): Shows the detailed process of a specific use case (or part of a use case).

State diagram (Statechart Diagram): Represents the different states in which a class is located and the state transformation information for that class.

Activity Diagram: Represents a Process control flow between two or more class objects when an activity is being processed.

Class Diagram: Indicates how different entities (people, things, and data) are related to each other, in other words, it shows the static structure of the system.

Component Diagram (Component Diagram): Provides a physical view of the system. Components (Component) represent information about the model code base, execution libraries, and other components. Components are the actual modules of code, and the primary user of the component diagram is the person responsible for controlling the code and compiling the deployed application. Some components are code libraries, and some are run components, such as executable files or dynamic-link library (DLL) files. )

Deployment diagram (Deployment view): Indicates how the software system is deployed to a hardware environment.

Data Model Diagram: Describes relational data structures.

Rational Rose 2003 Reverse Engineering convert C + + source code into UML class diagram

Related Article

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.