Total Pageviews

2011/01/05

Java to UML via NetBeans and IBM Rational Software Architect(RSA)

Scenario
I have 80+ tables in my system, and need to deliver class diagram before deadline. Even worse, the schema keep changing. I need to find an automation approach to resolve this problem.

Solution
1. Create table in database
2. Use NetBeans to create entities and DAOs.
3. Import into RSA, and create entities/DAOs UML symbo from Java classes
(If schema change in the future, just repeat step2 and step3)

Process

Create database connection in NetBeans

1. Create connection

2. Add jdbc jar file and click OK

3. Provide connection information

4. Assign schema name

5. Done

Use code generation from NetBeans
1. New --> Entity Classes from Database...

2. select database connection, and select tables which we would like to do code generation

3. Assign Java package

4. Assign association fetch and collection type, then click Next

5. Generating

6. Entities had been generated

7. New --> JSF Pages from Entities Classes

8. Select entity classes, and click Next

9. assign packages

10. Generating DAOs...

11. DAO classes

12. Owing to the naming convention doesn't meet our need, so we need to do refactor


13. DAO classes generation process is done.

Java to UML via IBM Rational Software Architect(RSA)
1. File --> Project

2. Select Java Project in RSA

3. assign project name and click Next

4. Click Finish

5. Create dao and entity package

6. Change to Modeling perspective

7. Right click --> Transform --> New Configuration

8. Select Java to UML

9. Select source and target, then click Finish

10. Click Run

11. Generating...

12. Finish

1 comment:

Unknown said...

Gracias por el aporte