CMSC 202 A Design Exercise. 2 OO design activities Finding the Objects Defining the responsibilities –Services –Attributes Discovering relationships.

Slides:



Advertisements
Similar presentations
Math and Card Games By: Candace DiBiano.
Advertisements

Ch4: Software Architecture and Design. 1 Object-oriented paradigm  Object-oriented decomposition:  Agents comprised of two parts:  Hidden implementation:
Lecture 10. Simplified roulette European roulette has numbers 0,1,…36. xD0s
Chapter 22 Object-Oriented Systems Analysis and Design and UML Systems Analysis and Design Kendall and Kendall Fifth Edition.
BLACKJACK SHARKS: Aabida Mayet, Omar Bacerra, Eser Kaptan March 15, 2010.
CSC 301H, Introduction to Software Engineering Fall 2009 TA Golnaz Elahi
Computer Science 313 – Advanced Programming Topics.
Object-Oriented Analysis and Design
1 Software Testing and Quality Assurance Lecture 12 - The Testing Perspective (Chapter 2, A Practical Guide to Testing Object-Oriented Software)
L3-1-S1 OO Concepts © M.E. Fayad SJSU -- CMPE Software System Engineering Dr. M.E. Fayad, Professor Computer Engineering Department, Room.
Slide 1 Systems Analysis & Design CS183 Spring Semester 2008 Dr. Jonathan Y. Clark Course Website:
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.
Basic OOP Concepts and Terms
OBJECT ORIENTED ANALYSIS & DESIGN Vassilka Kirova Department of Computer & Information Science NJIT.
7M701 1 Class Diagram advanced concepts. 7M701 2 Characteristics of Object Oriented Design (OOD) objectData and operations (functions) are combined 
Class Diagram & Object Diagram
Chapter Chapter 1 Introduction to Object-Oriented Programming and Software Development.
Systems Analysis & Design Sixth Edition Systems Analysis & Design Sixth Edition Toolkit Part 5.
Chapter 5 Black Jack. Copyright © 2005 Pearson Addison-Wesley. All rights reserved. 5-2 Chapter Objectives Provide a case study example from problem statement.
Sharif University of Technology Session # 7.  Contents  Systems Analysis and Design  Planning the approach  Asking questions and collecting data 
UML Class Diagrams: Basic Concepts. Objects –The purpose of class modeling is to describe objects. –An object is a concept, abstraction or thing that.
1 INTRODUCTION TO OOP Objective: Know the difference between functional programming and OOP Know basic terminology in OOP Know the importance of OOP Know.
Domain Modeling (with Objects). Motivation Programming classes teach – What an object is – How to create objects What is missing – Finding/determining.
The chapter will address the following questions:
OO Analysis and Design CMPS OOA/OOD Cursory explanation of OOP emphasizes ▫ Syntax  classes, inheritance, message passing, virtual, static Most.
Designing Classes OO Software Design and Construction Computer Science Dept Va Tech January 2002 ©2002 McQuain WD & Keller BJ 1 Designing the Classes Once.
INTROSE Introduction to Software Engineering Raymund Sison, PhD College of Computer Studies De La Salle University Analysis Modeling.
1 A Student Guide to Object- Orientated Systems Chapter 4 Objects and Classes: the basic concepts.
Inner and Anonymous Classes Though you are captive in the OO paradigm, you can use inner classes and anonymous classes to get around this constraint and.
11 Chapter 11 Object-Oriented Databases Database Systems: Design, Implementation, and Management 4th Edition Peter Rob & Carlos Coronel.
Exceptions: Checked versus Unchecked Exceptions.
Association Class Generalization/Specialization Whole-Part Page More Associations 1.
Words to Go. Discuss and Write Examples Discuss your response with a partner. Then, complete the sentence in writing. The most reliable way for teens.
Systems Analysis and Design in a Changing World, 6th Edition 1 Chapter 4 - Domain Classes.
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.
Systems Analysis and Design in a Changing World, 6th Edition 1 Chapter 4 Domain Classes.
CS3773 Software Engineering Lecture 04 UML Class Diagram.
Objectives:1. Classes and Objects 2. Attributes 3. Services 4. Subjects Object-Oriented Analysis – Finding Class-&-Obects.
NI ©UNITEN 2000/01 1 Faculty of Applied Engineering and Urban Planning Software Engineering Department Class Diagram Faculty of Information system Technology.
1 Class Diagrams: The Essentials. 2 Terms and Concepts A class is... The most important building block of any object-oriented system. A description of.
Modeling system requirements. Purpose of Models Models help an analyst clarify and refine a design. Models help simplify the complexity of information.
Basic OOP Concepts and Terms. In this class, we will cover: Objects and examples of different object types Classes and how they relate to objects Object.
CSC241 Object-Oriented Programming (OOP) Lecture No. 1.
1 What is OO Design? OO Design is a process of invention, where developers create the abstractions necessary to meet the system’s requirements OO Design.
What is a Structural Model?
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.
CIS 112 Exam Review. Exam Content 100 questions valued at 1 point each 100 questions valued at 1 point each 100 points total 100 points total 10 each.
Design Model Lecture p6 T120B pavasario sem.
1 Introduction to Classes. 2 Terms and Concepts A class is... –The most important building block of any object- oriented system. –A description of a set.
GamblingGambling What are the odds? Jessica Judd.
CMSC 345 Fall 2000 OO Design. Characteristics of OOD Objects are abstractions of real-world or system entities and manage themselves Objects are independent.
SWE 4743 Responsibility Driven Design with CRC cards Richard Gesick.
1 CSE Programming in C++. 2 Overview Sign roster list Syllabus and Course Policies Introduction to C++ About Lab 1 Fill Questionnaire.
OO DomainModeling With UML Class Diagrams and CRC Cards Chapter 6 Princess Nourah bint Abdulrahman University College of Computer and Information Sciences.
OBJECT-ORIENTED TESTING. TESTING OOA AND OOD MODELS Analysis and design models cannot be tested in the conventional sense. However, formal technical reviews.
Lecture 11.
The Object-Oriented Thought Process Chapter 1
Chapter 5 Black Jack.
Analysis and Design with UML: Discovering Classes and Relationships
Lecture 10.
Object Oriented Concepts -I
OO Domain Modeling With UML Class Diagrams and CRC Cards
Analysis and Design with UML: Discovering Classes and Relationships
Analysis and Design with UML: Discovering Classes and Relationships
Understand and Use Object Oriented Methods
Analysis and Design with UML: Classes and Relationships
Basic OOP Concepts and Terms
Chapter 22 Object-Oriented Systems Analysis and Design and UML
From Class Diagram to Contract Diagram
Presentation transcript:

CMSC 202 A Design Exercise

2 OO design activities Finding the Objects Defining the responsibilities –Services –Attributes Discovering relationships

3 Finding Objects In OO design, objects are the building blocks of our system Identifying objects is the most important and most difficult step Use the things to be modeled (nouns) relying on experience and knowledge of the application domain –Natural, direct, reliable –But, only helps us find tangible objects and terminal objects (those with no subclasses) Other techniques exist

4 Determining Responsibilities An object is an abstraction of something in the problem domain reflecting the capabilities of the system to keep information about it, interact with it, or both In OOD, we are interested in an object for its services. From system perspective, an object is defined by it’s public interface. But also need to identify the data necessary to support those services So, an object is the encapsulation of the of the attribute values (data) and associated methods (services)

5 What’s an Attribute? From analysis point of view it’s an abstraction of a real world characteristic from the problem domain From technical point of view, it’s a variable for which each instance of a class (object) holds it’s own value

6 Identifying Attributes What data do we believe the object is responsible for knowing and owning? –Look for adjectives and possessive phrases 40-year old man Color of the truck position of the cursor

7 Specifying attributes Yourdon/Coad – “Make each attribute capture an atomic concept” –Each attribute is either a single value or tightly related group of variables that the application treats as a whole Age Address (street, city, zipcode) Birthday (month, day, year)

8 What’s a service? Public work an object is willing to perform when requested by another object via message passing Defined by prototypes

9 Identifying Services Look for action verbs in the problem. English sentence form is usually “subject – action verb – object” Example : “A person hit the ball” –For OOD, this means that the Ball object defines the “receive a hit” service. –Ball must have a prototype service to receive the “hit” message from the person.

10 Specifying A Service By defining the prototype –Give a generic name –Define the signature by identifying argument list

11 Discovering Relationships Before object A can send a message to object B (to request a service), object A must have a “handle” to object B. One way for the calling object to have such a handle is to have a relationship (aggregation/composition or link) with the other object. No object is an island – objects typically depend on other objects for services. These interdependencies are called relationships. Relationships carry semantic meaning too

12 Types of relationships Generalization/specification –“is a” (later) Aggregation (composition) –“whole-part” or “has a” –Objects composed of other objects –Parts have some functional/structural relationship to the whole Links between objects (physical or conceptual) –Often seen as verbs -- “keeps track of”

13 Simplified BlackJack An interactive program to play the game of blackjack. The computer acts as the dealer and will play against the user (like in a casino). The object of the game is to get your cards as close to 21 without going over. Face cards count 10, Aces count 11. A hand begins with the player and dealer each getting two cards. The player asks for up to 3 more cards, one at a time, from the dealer until he wishes to stop or the total is over 21. The dealer then draws up to 3 more cards, one at a time while the total of his hand is less than 21. Once the dealers hand reaches 17 or higher, no more cards are dealt. If the dealer’s hand and player’s hand have the same value, or both are over 21, the hand is a draw. Otherwise, the hand closest to 21 wins. Hands are dealt repeatedly until there are not enough cards in the deck to deal a complete hand.