Top Banner
Object Oriented Design
17

Object Oriented Design. Goal Introduction to UML: u what are classes and instances? u Basic project analysis Introduction to Prototyping/AgentSheets.

Dec 22, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Object Oriented Design. Goal  Introduction to UML: u what are classes and instances? u Basic project analysis  Introduction to Prototyping/AgentSheets.

Object Oriented Design

Page 2: Object Oriented Design. Goal  Introduction to UML: u what are classes and instances? u Basic project analysis  Introduction to Prototyping/AgentSheets.

Goal

Introduction to UML: what are classes and instances? Basic project analysis

Introduction to Prototyping/AgentSheets Game #1: Frogger

Page 3: Object Oriented Design. Goal  Introduction to UML: u what are classes and instances? u Basic project analysis  Introduction to Prototyping/AgentSheets.

Why Object Oriented Design?

Page 4: Object Oriented Design. Goal  Introduction to UML: u what are classes and instances? u Basic project analysis  Introduction to Prototyping/AgentSheets.

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

Page 5: Object Oriented Design. Goal  Introduction to UML: u what are classes and instances? u Basic project analysis  Introduction to Prototyping/AgentSheets.

How much UML is enough?

Page 6: Object Oriented Design. Goal  Introduction to UML: u what are classes and instances? u Basic project analysis  Introduction to Prototyping/AgentSheets.

Diagrams Structural Diagrams (represent static application structure)

Class Diagram (examples) Object Diagram (examples) Component Diagram Deployment Diagram

Behavior Diagrams (represent different aspects of dynamic behavior) 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

Page 7: Object Oriented Design. Goal  Introduction to UML: u what are classes and instances? u Basic project analysis  Introduction to Prototyping/AgentSheets.

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)

Page 8: Object Oriented Design. Goal  Introduction to UML: u what are classes and instances? u Basic project analysis  Introduction to Prototyping/AgentSheets.

Problem Analysis

Page 9: Object Oriented Design. Goal  Introduction to UML: u what are classes and instances? u Basic project analysis  Introduction to Prototyping/AgentSheets.

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!

Page 10: Object Oriented Design. Goal  Introduction to UML: u what are classes and instances? u Basic project analysis  Introduction to Prototyping/AgentSheets.

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!

Page 11: Object Oriented Design. Goal  Introduction to UML: u what are classes and instances? u Basic project analysis  Introduction to Prototyping/AgentSheets.

Class 1: Frog Class name

Attributes

Operations

Frog

X: integer

Y: integer

hop ()

leap ()

drown ()

Page 12: Object Oriented Design. Goal  Introduction to UML: u what are classes and instances? u Basic project analysis  Introduction to Prototyping/AgentSheets.

Class 2: Highway Class name

Attributes

Operations

Highway

X: integer

Y: integer

Page 13: Object Oriented Design. Goal  Introduction to UML: u what are classes and instances? u Basic project analysis  Introduction to Prototyping/AgentSheets.

Class 3: Truck Class name

Attributes

Operations

Truck

X: integer

Y: integer

Direction: String

drive ()

Page 14: Object Oriented Design. Goal  Introduction to UML: u what are classes and instances? u Basic project analysis  Introduction to Prototyping/AgentSheets.

Class Diagram

Put all these boxes on one sheet of paper and you have the Class Diagram

Page 15: Object Oriented Design. Goal  Introduction to UML: u what are classes and instances? u Basic project analysis  Introduction to Prototyping/AgentSheets.

Object Diagram

The AgentSheets Worksheet IS THE Object Diagram Shows ALL the instances Indicates the relationships between instances

(spatially)

Page 16: Object Oriented Design. Goal  Introduction to UML: u what are classes and instances? u Basic project analysis  Introduction to Prototyping/AgentSheets.

Homework 2

Download AgentSheets Key will be emailed to you Build Frogger game Email project (Alex & Andri)

Windows: use “email project” feature Mac: stuff project folder

Due: Sept. 10 Read UML introduction: http://www.omg.org/

gettingstarted/what_is_uml.htm

Page 17: Object Oriented Design. Goal  Introduction to UML: u what are classes and instances? u Basic project analysis  Introduction to Prototyping/AgentSheets.

Announcements

Office hours change THIS WEEK ONLY Instead of Wednesday: Thursday, Sept 5, 2-

3pm