SE-1021 Software Development 2
Lab 3: UML Diagrams

Outcomes

Assignment

UML diagrams are often used to convey a software design to others; in this way, they can be considered "blueprints" for a program's implementation. At MSOE, we have a license to the Enterprise Architect application that should be pre-installed on your laptop. You have already seen the UML diagrams that Enterprise Architect produces (such as the one shown below). In this lab, you will practice using Enterprise Architect to reproduce the class diagram, as well as creating a Sequence diagram that illustrates the time-sequence of the instructions executed in a program's main() method.

Preparation
Prior to this lab, you should have completed the Creating a UML Class Diagram tutorial and the Creating a UML Sequence Diagram tutorial.

If not, complete these tutorials before proceeding to Part 1.

Part 1
Create a new EA project. Reproduce the one shown below - except that you may omit the WinPlotter part of the diagram - your instructor will show you how to include this automatically.

Part 2
Once you have completed Part 1, complete a Sequence diagram (complete the partial diagram below) that illustrates the time sequence of the instructions executed by the main() method of the following class:

public class ShapeCreatorApp {
	/**
	 * @param args not used
	 */
	public static void main(String[] args) {
		WinPlotter p = new WinPlotter(); // create the WinPlotter object
		initWinPlotter(p);	// delegate initialization of the WinPlotter object to a method

		Shape s1 = new Shape(60, 15, Color.orange);
		s1.draw(p);

		Shape s2 = new Shape(88, 18, Color.red);
		s2.draw(p);

		Shape t1 = new Triangle(50, 10, 50, 25, Color.green);
		t1.draw(p);
		
		Shape c1 = new Circle( 75, 55, 5, Color.red );
		c1.draw(p);
	}

	/**
	 * This method initializes the WinPlotter object
	 * @param p reference to a WinPlotter object created in main()
	 */
	public static void initWinPlotter(WinPlotter p) {
		p.setWindowTitle("Lab 3");
		p.setWindowSize(800, 600);				// set window size
		p.setPlotBoundaries(-5, -5, 105, 75);	// set logical boundaries
		p.setGrid(true, 10, 10, Color.GRAY);	// setup a grid
		// set the background to black
		p.setBackgroundColor( 0,0,0 );	
	}

}

Lab Submission (due date in Blackboard)

  1. Demonstrate your EA project to your instructor.
  2. Add a property note to containing your name to both your class and sequence diagrams by using the Property Note command found in the Diagram menu.
  3. Create separate .png or .jpg image files of your class and sequence diagrams by doing the following for each:
  4. Upload your files through Blackboard (assignment "Lab 3: UML Diagrams"). Be sure to keep copies of all your files, in case something gets lost. Be sure to save your Enterprise Architect project file when closing EA.

Your grade will be based on the following criteria: