Download presentation
Presentation is loading. Please wait.
1
Object Oriented Design
2
Goal Introduction to UML: u what are classes and instances? u Basic project analysis Introduction to Prototyping/AgentSheets u Game #1: Frogger
3
Why Object Oriented Design?
4
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.orghttp://www.omg.org
5
How much UML is enough?
6
Diagrams Structural Diagrams (represent static application structure) u Class Diagram (examples)examples u Object Diagram (examples)examples u Component Diagram u Deployment Diagram Behavior Diagrams (represent different aspects of dynamic behavior) u Use Case Diagram u Sequence Diagram u Activity Diagram u Collaboration Diagram u Statechart Diagram Model Management Diagrams (ways you can organize and manage your application modules) u Packages u Subsystems u Models
7
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)
8
Problem Analysis
9
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!
10
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!
11
Class 1: Frog Class name Attributes Operations Frog X: integer Y: integer hop () leap () drown ()
12
Class 2: Highway Class name Attributes Operations Highway X: integer Y: integer
13
Class 3: Truck Class name Attributes Operations Truck X: integer Y: integer Direction: String drive ()
14
Class Diagram Put all these boxes on one sheet of paper and you have the Class Diagram
15
Object Diagram The AgentSheets Worksheet IS THE Object Diagram u Shows ALL the instances u Indicates the relationships between instances (spatially)
16
Homework 2 Download AgentSheets u Key will be emailed to you u Build Frogger game u Email project (Alex & Andri) Windows: use “email project” feature Mac: stuff project folder u Due: Sept. 10 Read UML introduction: http://www.omg.org/gettingstarted/what_is_uml.htm http://www.omg.org/gettingstarted/what_is_uml.htm
17
Announcements Office hours change THIS WEEK ONLY u Instead of Wednesday: Thursday, Sept 5, 2- 3pm
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.