LAB 1. Familiarization of Rational Rose Environment And UML for small Java Application Development



Similar documents
Appendix A Using the Java Compiler

Java Software Development Kit (JDK 5.0 Update 14) Installation Step by Step Instructions

How to Install Java onto your system

Lab Manual: Using Rational Rose

Using Rational Rose to Create Object-Oriented Diagrams

Installing Java. Table of contents

Creating a Java application using Perfect Developer and the Java Develo...

Manual For Using the NetBeans IDE

Supplement I.B: Installing and Configuring JDK 1.6

Click Start > Control Panel > System icon to open System Properties dialog box. Click Advanced > Environment Variables.

For Introduction to Java Programming, 5E By Y. Daniel Liang

Appendix 1 Install RightNow on your PC

Supplement I.B: Installing and Configuring JDK 1.6

How to use the Eclipse IDE for Java Application Development

How to create pop-up menus

Before you can use the Duke Ambient environment to start working on your projects or

Installing the Android SDK

Lab 1A. Create a simple Java application using JBuilder. Part 1: make the simplest Java application Hello World 1. Start Jbuilder. 2.

1. Tutorial Overview

WebSphere Business Monitor V7.0 Business space dashboards

WA1826 Designing Cloud Computing Solutions. Classroom Setup Guide. Web Age Solutions Inc. Copyright Web Age Solutions Inc. 1

Installing (1.8.7) 9/2/ Installing jgrasp

WA2262 Applied Data Science and Big Data Analytics Boot Camp for Business Analysts. Classroom Setup Guide. Web Age Solutions Inc.

WebSphere Business Monitor V6.2 Business space dashboards

WA Continuous Integration with Jenkins- CI, Maven and Nexus. Classroom Setup Guide. Web Age Solutions Inc. Web Age Solutions Inc.

Intro to Web Development

Java. How to install the Java Runtime Environment (JRE)

WA2087 Programming Java SOAP and REST Web Services - WebSphere 8.0 / RAD 8.0. Student Labs. Web Age Solutions Inc.

Configuring a Custom Load Evaluator Use the XenApp1 virtual machine, logged on as the XenApp\administrator user for this task.

1001ICT Introduction To Programming Lecture Notes

A. BACK UP YOUR CURRENT DATA. QuickBooks Business Accounting Software for Windows Account Conversion Instructions

Installing Java 5.0 and Eclipse on Mac OS X

Mapping ITS s File Server Folder to Mosaic Windows to Publish a Website

Building an Embedded Processor System on a Xilinx Zync FPGA (Profiling): A Tutorial

GridWorld Installation Guide

Perform this procedure when you need to add a recurring payment option, or when you need to change or withdraw it.

Building and Using Web Services With JDeveloper 11g

Supplement I.C. Creating, Compiling and Running Java Programs from the Command Window

You must have at least Editor access to your own mail database to run archiving.

Right now, the latest and greatest version of Java available for download is Start with this link to find out more about it

WebSphere Business Monitor V6.2 KPI history and prediction lab

WHAT ARE PACKAGES? A package is a collection of related classes. This is similar to the notion that a class is a collection of related methods.

Using the Findlay City Schools Help Desk Program. This document describes how to submit a helpdesk request into the new system for the first time.

ProjectWise Explorer V8i User Manual for Subconsultants & Team Members

SQL Server 2005: Report Builder

Introduction to the use of the environment of Microsoft Visual Studio 2008

Part II Acrobat 8 Professional

Working with SQL Server Integration Services

EMC Documentum Composer

Download and Installation Instructions. Android SDK and Android Development Tools (ADT)

PC Agent Quick Start. Open the Agent. Autonomy Connected Backup. Version 8.8. Revision 0

Installing Ruby on Windows XP

Quick and Easy Solutions With Free Java Libraries Part II

How to Configure Windows 8.1 to run ereports on IE11

Configure Single Sign on Between Domino and WPS

10 STEPS TO YOUR FIRST QNX PROGRAM. QUICKSTART GUIDE Second Edition

Changing Your Cameleon Server IP

Installing Java (Windows) and Writing your First Program

Introduction to Simulink

2 Getting Started with jgrasp 2.0

As your financial institution completes its system conversion, you

POOSL IDE Installation Manual

Setting Up a Windows Virtual Machine for SANS FOR526

Generating lesson plans with. Adobe Acrobat

Lesson 1 - Creating a Project

How To Create A Hyperlink In Publisher On Pc Or Macbookpress.Com (Windows) On Pc/Apple) On A Pc Or Apple Powerbook (Windows 7) On Macbook Pressbook (Apple) Or Macintosh (Windows 8

Using Group Policies to Install AutoCAD. CMMU 5405 Nate Bartley 9/22/2005

5.6.2 Optional Lab: Restore Points in Windows Vista

Using the CCNY Server Space with Secure Shell 3.0 for Windows Created by Doris Grasserbauer

Virtual Office Remote Installation Guide

Supply Chain Finance WinFinance

Using SSH Secure Shell Client for FTP

AUSTRALIAN CUSTOMS AND BORDER PROTECTION SERVICE TYPE 3 CERTIFICATE 2014 INSTALLATION GUIDE

Mouse and Pointer Settings. Technical Brief

Part 1 Foundations of object orientation

Mesa DMS. Once you access the Mesa Document Management link, you will see the following Mesa DMS - Microsoft Internet Explorer" window:

Video Administration Backup and Restore Procedures

Using Eclipse to Run Java Programs

Installing LearningBay Enterprise Part 2

CS170 Lab 11 Abstract Data Types & Objects

REMOTE DESKTOP SETUP INSTRUCTIONS

Standard Client Configuration Requirements

Practice Fusion API Client Installation Guide for Windows

ParishSOFT Remote Installation

Jump-Start Tutorial For ProcessModel

Java with Eclipse: Setup & Getting Started

LAB 1: Installing Active Directory Federation Services

Android Environment SDK

Enhancing the SAS Enhanced Editor with Toolbar Customizations Lynn Mullins, PPD, Cincinnati, Ohio

Introduction to programming

This manual provides information and instructions for Mac SharePoint Users at Fermilab. Using Sharepoint from a Mac: Terminal Server Instructions

Opening a Command Shell

How to work with Sub Drawing

Lab - Configure a Windows 7 Firewall

5.6.3 Lab: Registry Backup and Recovery in Windows XP

Publishing, Consuming, Deploying and Testing Web Services

Xilinx ISE. <Release Version: 10.1i> Tutorial. Department of Electrical and Computer Engineering State University of New York New Paltz

Transcription:

LAB 1 Familiarization of Rational Rose Environment And UML for small Java Application Development OBJECTIVE AND BACKGROUND 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. WEB SITE REFERENCES Professor Lin s Web site: http://www.etcs.ipfw.edu/~lin Rational, the Software Development Company www.rational.com EQUIPMENT AND SOFTWARE PC (256 Mbytes, Windows 95/98/2000 OS) Rational Rose Enterprise Software SUN Java Development Tool kit J2SE (standard edition) or J2EE (enterprise edition) Notepad editor PROCEDURE a. A Tour of Rational Rose Environment Application Window: a title bar, tool bar, menu bar, and a work area for displaying toolbox, browser, document window, diagram window, and specification window Browser: a window with navigation tool for viewing diagrams and many other model elements Documentation Window: for preparing text information to describe model elements or relationships Diagram Windows Overview Window: can be showed through put the mouse pointer over hand icon Other windows such as Log, Edit, can be access through View on menu bar

Title Bar Menu Bar Tool Bar Browser Documentation Window Toolbox Diagram Window

Specification Window b) Creating a simple application (Hello.java) Step 1: Run Rational Rose Enterprise Step 2: Create a Use Case Diagram 1. Click on Use Case View > Main

2. From the menu bar select Tool > Create > Use Case 3. Select the Actor from the Toolbox and place it into the Use Case Diagram 4. Right click on the Actor to see the pop-up menu, and then select Open Specification menu 5. Select the Use Case from the Toolbox and place it into the User Case Diagram 6. Right click on the User case to change the name to HelloUML Actor HelloUML Step 3: Create Hello Class Diagram (classes, attributes, and operations) 1. Click on Use Logical View > Main

2. Create a new class called Hello - Tools > Create > Class - Select the Class icon (rectangle box symbol) from the Toolbox - Place a class to the workspace of the Class Diagram - Type in a desired class name: Hello - Right click the new class diagram and select Open Specification - View the class name in the name box: Hello - Select class in the Type combo box

3. Add Attributes to the Hello class - Right click the Hello class to select New Attributes from a dialog box - Accept the default name, and hit enter - Right click the Hello class again to select Open Specification - The window called Class Specification for Hello is then displayed; change the attribute name to message; select Type as: String; specify Initial Value with a pair double quotes as: Hello UML ; set Export Control to: private

4. Add Operations to the Hello class - Right click the Hello class to get an dialog box - Select New Operations, and give a new method name as getname, then hit Enter key to enter another method name as Hello - Double click the getname method to display Operation Specification menu for getname dialog box - Add return type as: String; add some information on this operation method to Document text box 5. Change Operation Specification for Hello method - Right click on the class diagram Hello to select Operation Specification for showing Class Specification for Hello - Select Implementation radio button in the Export Control - Verify the Hello class diagram is the same as shown below.

Hello message : String = "Hello UML" getname() Hello() Step 4. Create the Test Class Diagram 1. Select Class icon from the Toolbox 2. Place a class into the workspace Class Diagram, and give the class name: Test 3. Right click on the Test class, and select New Operations 4. Add two methods: main and Test

Test main() Test() Step 5. Object Instantiation 1. Select the dash line icon (Dependency or instaintiates) 2. Draw the line starting from the Test to Hello to make an object instantiation

Step 6. Code Generation 1. From the menu bar, select Tools > Java/J2EE > Project Specification.

2. Double-click on the last one of the Classpaths as shown in the following diagram. 3. Click on the button with three dots to see a dialog box. 4. Choose Directory.

5. Select the class diagrams, Test and Hello by left clicking on Test first and hold down Ctrl key and left click on Hello class. 6. From the menu bar, select Tools> Java/J2EE> Generate Code. Choose your working directory and click OK.

The following warning message from the dialog box and Log windows is OK for the time being: 20:47:43 WARNING: Class Logical View::Test - no return type has been specified for operation main - default will be used The following codes in Hello.java and Test.java are generated //Source file: C:\\My Documents\\Hello.java class Hello private String message = "Hello UML"; /** * @roseuid 3C4762C801C8 */

public Hello() /** * @return String * @roseuid 3C4762A1029E */ public String getname() return null; //Source file: C:\\My Documents\\Test.java public class Test /** * @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.

8. Create a new set static by cloning. Type in the name static in the following dialog box.

8. Change static to be true.

9. Select two classes Test and Hello. Code generate again with the command from menu bar Tools> Java/J2EE> Generate Code and no error message should appear this time. Step 7. Java Code Editing 1. Open source java files in Notepad and edit those files as shown below. Or use any other Development Environment such as JBuilder or JCreator. Change or add according to the highlighted words in the java source files. //Source file: E:\\lwinmoe\\lab1\\Hello.java public class Hello private String message = "HelloUML"; /** * @roseuid 3C47663F006F */ public Hello()

/** * @return String * @roseuid 3C47663A025C */ public String getname() return message; //Source file: E:\\lwinmoe\\lab1\\Test.java public class Test /** * @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 Step 8. Compiling and Running Java Program from Command Line 1. To compile Hello.java and Test.java from command line, open a command shell. 2. Make sure the path is set to c:\jdk1.3.1_01\bin or the directory where Java Development Kit (JDK) was installed. 3. Run javac program with the source file Hello.java with the parameter name. Do the same for Test.java. 4. Run your Test program with the command >java Test