📄 javaread.txt
字号:
Generating Code for Java
The purpose of this paper is to describe how to generate Java code from class diagrams, state diagrams, and object interaction diagrams. These scripts are "getting started" scripts that must be updated for your development environment.
These scripts are "getting started" scripts that must be updated for your development environment.
1. Generating Java from a class diagram. The following are the Java Code generation scripts.
These scripts assume long file names.
JAVA0.SCT - Creates Java file - minimum code
Class Diagram: JAVACAR.OMT
Script File: JAVA0.SCT
2. Java Code Generation from State Diagrams
The following are the general steps to test out the Java code generation scripts from state diagrams:
1. Create a directory for the state .omt files, script files, and Java files, e.g. JAVSTATE.SCT.
2. In With Class open a state diagram, e.g. JAVSTATE.OMT.
3. Select "Utilities - Generate State Code/Report" to generate a text report. Enter a report file name, e.g. RPTSTATE.TXT. Select a state report script, e.g. RPTSTATE.SCT, DDSTATE.SCT, or TABSTATE.SCT. After report generation, select "File - Edit File" to examine the generated report.
4. Select "Utilities - Generate State Code/Report" to generate Java code.
5. Enter the file name, e.g. CONTROLL.JAVA
6. Select the code generation script, e.g. JAVSTATE.SCT.
7. Select "Edit - Edit File" and open CONTROLL.JAVA for review.
8. In your Java environment, compile the generated code, e.g. CONTROLL.JAVA.
9. Go back to With Class and update the state diagram with new states, events, conditions, and actions and repeat the entire process.
3. Creating Message Sequence Tables from Object Interaction Diagrams
Object Interaction Diagram: CAROBJ.OMT
Script File: TABOBJ.SCT
The following are the general steps to generate the message sequence table and then update Java code with messages.
- Open the object interaction diagram, e.g. CAROBJ.OMT.
- Select "Utilities - Generate Object Code/Report".
- Enter a report name, e.g. TABMSG.TXT.
- Browse and select the message sequence table script, e.g. TABOBJ.SCT to generate the message sequence table.
- Cut and paste messages from the message sequence table into your code.
- As required update the object interaction diagram and the message sequence script (TABOBJ.SCT) and repeat the process.
4. Updated scripts are requested. Many thanks, Richard Felsinger, RCF Associates 960 Scottland Dr, Mt Pleasant, SC 29464 telephone 803-881-3648 e-mail 71162.755@compuserve.com
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -