LAB 1. Familiarization of Rational Rose Environment and UML For Small Java Application Development PDF
LAB 1. Familiarization of Rational Rose Environment and UML For Small Java Application Development PDF
The purpose of this first UML lab is to familiarize programmers with Rational
Rose UML environment and Java application development. We will learn how to
work with Rational Rose Enterprise software, Case diagram, and Class Diagram.
We will also learn how to create a Use Case, two Java classes called HelloUML
and Test, generate Java code, edit the Java code, and compile the Java
program. At the end of this lab, you should be able to run the program Test to
display HelloUML message under the Window’s command line.
PROCEDURE
Browser
HelloUML
Actor
getName()
Hello()
main()
Test()
20:47:43| WARNING: Class Logical View::Test - no return type has been specified
for operation main - default will be used
/**
* @roseuid 3C4762C801C8
*/
/**
* @return String
* @roseuid 3C4762A1029E
*/
public String getName()
{
return null;
}
}
/**
* @roseuid 3C47635B0350
*/
public Test()
{
}
/**
* @roseuid 3C476355017B
*/
public void main()
{
}
}
7. main() is not static method in the generated codes. To change the
method to static type: Right click on the class, Test, the dialog box will
appear. Click on Operations tab. Double click on main method and
another dialog box will appear. Click on “java” tab and the following dialog
box will appear. Click on “Edit Set” button.
/**
* @roseuid 3C47663F006F
*/
public Hello()
{
/**
* @return String
* @roseuid 3C47663A025C
*/
public String getName()
{
return message;
}
}
/**
* @roseuid 3C4766960237
*/
public Test()
{
}
/**
* @return Void
* @roseuid 3C4766930387
*/
public static void main(String[] args)
{
Hello h = new Hello(); // instantiate a Hello object called h
System.out.println(h.getName()); // call getName() method from Hello object
// h
}
}