Georgia Institute of Technology Object-Oriented Analysis Barb Ericson June 2006.

Slides:



Advertisements
Similar presentations
Introduction to Object Orientation System Analysis and Design
Advertisements

1 Object-oriented design Part 2: OO tools & UML. 2 CRC cards Design tool & method for discovering classes, responsibilities, & relationships Record on.
Georgia Institute of Technology Workshop for CS-AP Teachers Chapter 3 Advanced Object-Oriented Concepts.
UML Class and Sequence Diagrams Violet Slides adapted from Marty Stepp, CSE 403, Winter 2012 CSE 403 Spring 2012 Anton Osobov.
Ch 12: Object-Oriented Analysis
Chapter 15: System Modeling with UML
UML – Class Diagrams.
©Ian Sommerville 2006Software Engineering, 8th edition. Chapter 8 Slide 1 System models.
Slide 1 Chapter 7 Structural Modeling. Slide 2 Key Ideas A structural or conceptual model describes the structure of the data that supports the business.
Modified from Sommerville’s originalsSoftware Engineering, 7th edition. Chapter 8 Slide 1 System models.
Modified from Sommerville’s originalsSoftware Engineering, 7th edition. Chapter 8 Slide 1 System models.
1 TCSS 360, Spring 2005 Lecture Notes Design Phase and UML Class Diagrams Relevant Reading: UML Distilled, Third Edition M. Fowler.
Domain Modeling (with Objects). Motivation Programming classes teach – What an object is – How to create objects What is missing – Finding/determining.
Unified Modeling Language
Business Modeling Domain Modeling Source: Use Case Driven Object Modeling with UML – A Practical Approach By Doug Rosenberg ISBN:
Unified Modeling Language
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 1 System models l Abstract descriptions of systems whose requirements are being.
OO Analysis and Design CMPS OOA/OOD Cursory explanation of OOP emphasizes ▫ Syntax  classes, inheritance, message passing, virtual, static Most.
OO Design Notations Original version by B.Rogers/M.Utting.
Object-oriented methodology object models use case modeling unified modeling language the data dictionary the cornucopia case portfolio project Systems.
Object Oriented Analysis By: Don Villanueva CS 524 Software Engineering I Fall I 2007 – Sheldon X. Liang, Ph. D.
From Problem Statement to Design
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 1 System models l Abstract descriptions of systems whose requirements are being.
Chapter 4 System Models A description of the various models that can be used to specify software systems.
1 Java Inheritance. 2 Inheritance On the surface, inheritance is a code re-use issue. –we can extend code that is already written in a manageable manner.
11 Partnership for Performance How to hear this lecture Click on the icon: to hear the narration for each slide.
Copyright 2002 Prentice-Hall, Inc. Chapter 2 Object-Oriented Analysis and Design Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey.
CSC 395 – Software Engineering Lecture 13: Object-Oriented Analysis –or– Let the Pain Begin (At Least I’m Honest!)
Review: Cohesion and Coupling, Mutable, Inheritance Screen Layouts Software methodologies – Extreme Programming Object-Oriented Design – CRC Cards - UML.
Slide 1 Structural Modeling Chapter 7. Slide 2 Key Ideas A structural or conceptual model describes the structure of the data that supports the business.
Understanding Objects and Classes
Chapter 7 System models.
Modified by Juan M. Gomez Software Engineering, 6th edition. Chapter 7 Slide 1 Chapter 7 System Models.
Structural Modeling. Objectives O Understand the rules and style guidelines for creating CRC cards, class diagrams, and object diagrams. O Understand.
CS3773 Software Engineering Lecture 04 UML Class Diagram.
Software Engineering, 8th edition Chapter 8 1 Courtesy: ©Ian Somerville 2006 April 06 th, 2009 Lecture # 13 System models.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 14 Slide 1 Object-oriented Design.
1 Class Diagrams: Advanced Concepts. 2 Overview Class diagrams are the most commonly used diagrams in UML. Class diagrams are the most commonly used diagrams.
31-Oct-15 Simple UML IB Computer Science. 2 What is UML? UML stands for Unified Modeling Language UML is a diagramming language designed for Object- Oriented.
Lecture 6: Structural Modeling
 What is Modeling What is Modeling  Why do we Model Why do we Model  Models in OMT Models in OMT  Principles of Modeling Principles of Modeling 
Structural Modeling Chapter 7. Key Ideas A structural or conceptual model describes the structure of the data that supports the business processes in.
1 Structural Modeling Chapter 7. 2 Key Ideas A structural or conceptual model describes the structure of the data that supports the business processes.
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved COS240 O-O Languages AUBG,
Design Model Lecture p6 T120B pavasario sem.
Introduction to UML CS A470. What is UML? Unified Modeling Language –OMG Standard, Object Management Group –Based on work from Booch, Rumbaugh, Jacobson.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 8 Slide 1 System models.
ITEC324 Principle of CS III Chapter 2 (Horstmann’s Book) – Part 1 The Object-Oriented Design Process Hwajung Lee.
Object-Oriented Application Development Using VB.NET 1 Chapter 5 Object-Oriented Analysis and Design.
Object Modeling THETOPPERSWAY.COM. Object Modelling Technique(OMT)  Building a model of an application domain and then adding implementation.
ITEC0724 Modern Related Technology on Mobile Devices Lecture Notes #2 1.
Object Oriented Programming and Data Abstraction Earl Huff Rowan University.
Unified Modeling Language (UML)
Georgia Institute of Technology Comic Strip Analysis and Design Inheritance, Abstract Classes, and Polymorphism part1 Barb Ericson Georgia Institute of.
Object Oriented Analysis & Design By Rashid Mahmood.
Chapter 2 (Horstmann’s Book) – Part 1 The Object-Oriented Design Process Hwajung Lee.
General Principles in Assigning Responsibilities Responsibilities Responsibility-Driven Design CRC Cards GRASP.
Unified Modeling Language
Object-Oriented Analysis and Design
Analysis and Design with UML: Discovering Classes and Relationships
Reference: COS240 Syllabus
Object-Oriented Analysis
Analysis and Design with UML: Discovering Classes and Relationships
Barb Ericson Georgia Institute of Technology May 2006
Analysis and Design with UML: Discovering Classes and Relationships
Systems Analysis and Design With UML 2
Slides by Steve Armstrong LeTourneau University Longview, TX
Analysis and Design with UML: Classes and Relationships
Workshop for Programming And Systems Management Teachers
From Class Diagram to Contract Diagram
Presentation transcript:

Georgia Institute of Technology Object-Oriented Analysis Barb Ericson June 2006

Georgia Institute of Technology Learning Goals Understand at a practical level –How to identify objects and classes –How to record potential classes –How to record responsibilities –How to record fields and methods –How to record the relationships between classes

Georgia Institute of Technology Objects and Classes To write an object-oriented program we need to identify the objects that we need to create –And determine how to classify them What data does an object need to keep about itself? These are the fields. What things should an object be able to do? These are the methods. Next we write a class for each classification of the needed objects

Georgia Institute of Technology Identifying Classes As you go through a scenario –Write down each noun you hear (or underline each noun if the scenario is written) –Put each one at the top of an index card –Write down what objects of this class are responsible for –Write down what other classes this object has to work with to accomplish it’s responsibilities

Georgia Institute of Technology CRC Cards Class Responsibility Collaborators Developed by Ward Cunningham and Kent Beck at Tektronix in the late 1980’s Analysis technique Classname ResponsibilitiesCollaborators

Georgia Institute of Technology Use and Advantages Used to –Record classes as they are identified –Record the purpose (responsibility) of each class –Record and experiment with relationships (collaborators) between classes Advantages –cheap, portable, readily available, and familiar –focus on analysis, not on a diagram –good in a group discussion

Georgia Institute of Technology CRC Cards Example Do an analysis of a hotel room reservation system. –The system must allow clerks to assign rooms to customers. It must also allow clerks to assign maids to clean the rooms. Clerk Maid Customer Room

Georgia Institute of Technology CRC Cards Example Clerk Checks customer in and out Manages maids Customer Maid Cleans roomRoom Clerk Customer Stays in hotelRoom Clerk Room Place for customer to stay Customer Maid

Georgia Institute of Technology CRC Card Example Clerk Checks customer in and out Assigns room Handles payment Manages maids Assigns room Customer Maid Cleans room Assigned room Cleans room Room Clerk Customer Stays in hotel Check in Check out Pay for room Use phone Room Clerk Room Place for customer to stay Customer Maid

Georgia Institute of Technology Abstraction Pull out only the important details about the thing we are simulating –Maids have hobbies but we don’t need to know about them What is important in the context of the problem? –What data will objects of the class need –What things will they need to be able to do?

Georgia Institute of Technology Analysis of Selling Items on a Web Site We want to sell items on a web site and we need to keep track of our customers and their orders –Create CRC cards for this Do a walk through of placing an order –Did you find any new objects, data, or methods that you might need? It can help to look at some sample web sites like amazon.com

Georgia Institute of Technology CRC Card Practice Ideas Do CRC cards for a game of battleship Do CRC cards for a game of blackjack Do CRC cards for a game of war Do CRC cards for a drawing program Do CRC cards for airplane flights Do CRC cards for a bookstore website Do CRC cards for an ATM

Georgia Institute of Technology Drawing Editor Exercise Identify the classes for a simple drawing editor. Also show the data and operations for the classes. –The editor can draw rectangles, circles, and triangles. It can show connections between shapes with a a line. The shapes can be erased, moved, and rotated.

Georgia Institute of Technology Record Class Information Can use a UML Class Diagram –Unified Modeling Language Standard way to documents OO analysis, design, and implementations UML Specification – mal/uml.htm

Georgia Institute of Technology UML Tools Popular Tools –Rational Rose – Market leader but expensive –Visio – –Poseidon - Free community edition –ArgoUML - –Links to sites that list UML Tools is at – #Links-Methodologieshttp:// #Links-Methodologies

Georgia Institute of Technology Class Diagram Shows classes and the relationships between them –Static structure Not time dependent Most important and commonly used diagram in UML

Georgia Institute of Technology Class Representation Rectangles are used to represent classes There are different sections for the class name, attributes and operations Class Name Attribute1 Attribute2 Operation1() Operation2() Dog size shape wagTail() bark()

Georgia Institute of Technology Visibility Who can access the item Types of Visibility –Public (+) All can use –Private (-) Only objects of the class Attributes should be private –So the object has control of its’ data Methods are public or private –Public if intended as a service. Private if for internal use. Occasionally protected is used which subclasses can override

Georgia Institute of Technology Static Class Relationships Association –has-a –A connector has shapes Generalization –is-a-kind-of –A circle is a kind of shape Aggregation –is-a-part-of –A display list is an aggregation (collection) of shapes

Georgia Institute of Technology Dynamic Class Relationship Dependency –Uses –A car uses a parking space –It doesn’t have a have- a relationship with it Dynamic relationships are relationships that change over time

Georgia Institute of Technology Association Multiplicities Associations have multiplicities (one for each end) –X can have how many objects of y associated with it? –Y can have how many objects of x associated with it? Kinds of Multiplicities –m..n Inclusive range from m to n –n There must be exactly n –* or 0..* 0 to many

Georgia Institute of Technology Roles Each association end is a role –role A –role B Roles can be explicitly named –Especially useful when there is more than one association between the classes –Or for use in generated code

Georgia Institute of Technology Class Diagram Perspectives There are three perspectives that a class diagram can represent –Conceptual - Analysis Stage Language independent, represents the domain –Specification - Design Stage Represents a high level design of the solution –Implementation – Programming Stage Represents the actual solution Shows attributes, operations, types (if needed), and parameters to operations

Georgia Institute of Technology Bingo Exercise What objects are there in Bingo? –What data do these objects have? –What things can they do? –How do you classify them? For each class in Bingo –What is the relationship with the other classes? Draw a UML diagram for a Bingo Game

Georgia Institute of Technology UML Challenge Draw a class diagram for Solitaire

Georgia Institute of Technology Solitaire Class Diagram

Georgia Institute of Technology Summary In Analysis you need to understand the objects in the domain (“real world”) Figure out what the objects are responsible for –What data do they need to have? –What things can they do? UML class diagrams show lots of information in a picture –Can be helpful on exam questions About inheritance and polymorphism Determine the relationships between the classes –Has a (association) –Is a type of (inheritance)