Object Oriented Design Goal Introduction to UML what
Object Oriented Design
Goal Introduction to UML: what are classes and instances? Basic project analysis Introduction Game to Prototyping/Agent. Sheets #1: Frogger
Why Object Oriented Design?
UML = Unified Modeling Language helps you specify, visualize, and document models of object-oriented software systems, including their structure and design. More information: http: //www. omg. org
How much UML is enough?
Diagrams Structural Diagrams (represent static application structure) Behavior Diagrams (represent different aspects of dynamic behavior) Class Diagram (examples) Object Diagram (examples) Component Diagram Deployment Diagram Use Case Diagram Sequence Diagram Activity Diagram Collaboration Diagram Statechart Diagram Model Management Diagrams (ways you can organize and manage your application modules) Packages Subsystems Models
Game 1: Frogger You are a frog. Your task is simple: hop across a busy highway, dodging cars and trucks, until you get the to the edge of a river, where you must keep yourself from drowning by crossing safely to your grotto at the top of the screen by leaping across the backs of turtles and logs. But watch out for snakes and alligators! (Sega, 1980)
Problem Analysis
What are the Object Classes/Instances? Step #1: Mark nouns You are a frog. Your task is simple: hop across a busy highway, dodging cars and trucks, until you get the to the edge of a river, where you must keep yourself from drowning by crossing safely to your grotto at the top of the screen by leaping across the backs of turtles and logs. But watch out for snakes and alligators!
What are the Operations/Methods? Step #2: Mark verbs You are a frog. Your task is simple: hop across a busy highway, dodging cars and trucks, until you get the to the edge of a river, where you must keep yourself from drowning by crossing safely to your grotto at the top of the screen by leaping across the backs of turtles and logs. But watch out for snakes and alligators!
Class 1: Frog X: integer Y: integer hop () leap () drown () Class name Attributes Operations
Class 2: Highway X: integer Y: integer Class name Attributes Operations
Class 3: Truck X: integer Y: integer Direction: String drive () Class name Attributes Operations
Class Diagram Put all these boxes on one sheet of paper and you have the Class Diagram
Object Diagram The Agent. Sheets Worksheet IS THE Object Diagram Shows ALL the instances Indicates the relationships between instances (spatially)
Homework 2 Download Agent. Sheets Key will be emailed to you Build Frogger game Email project (Alex & Andri) Windows: use “email project” feature Mac: stuff project folder Due: Read Sept. 10 UML introduction: http: //www. omg. org/gettingstarted/what_is_uml. htm
Announcements Office hours change THIS WEEK ONLY Instead 3 pm of Wednesday: Thursday, Sept 5, 2 -
- Slides: 17