Concepts in Object-Oriented Design CSCI 240 Dale Roberts, Lecturer Computer Science, IUPUI

Slides:



Advertisements
Similar presentations
1 OBJECT-ORIENTED CONCEPTS. 2 What is an object?  An object is a software entity that mirrors the real world in some way.  A software object in OOP.
Advertisements

Object-Oriented Analysis and Design: Object Modeling – Class Diagrams
OBJECT ORIENTED PROGRAMMING M Taimoor Khan
Chapter 22 Object-Oriented Systems Analysis and Design and UML Systems Analysis and Design Kendall and Kendall Fifth Edition.
Georgia Institute of Technology Workshop for CS-AP Teachers Chapter 3 Advanced Object-Oriented Concepts.
Classes and Object- Oriented... tMyn1 Classes and Object-Oriented Programming The essence of object-oriented programming is that you write programs in.
OBJECT-ORIENTED PROGRAMMING. What is an “object”? Abstract entity that contains data and actions Attributes (characteristics) and methods (functions)
ITEC200 – Week03 Inheritance and Class Hierarchies.
2-1 © Prentice Hall, 2007 Chapter 2: Introduction to Object Orientation Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph.
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.
Chapter Object-Oriented Practices. Agenda Object-Oriented Concepts Terminology Object-Oriented Modeling Tips Object-Oriented Data Models and DBMSs.
CSE 115 / 503 Introduction to Computer Science For Majors I Carl Alphonce 219 Bell Hall.
Irwin/McGraw-Hill Copyright © 2004 The McGraw-Hill Companies. All Rights reserved Whitten Bentley DittmanSYSTEMS ANALYSIS AND DESIGN METHODS6th Edition.
OBJECT ORIENTED ANALYSIS & DESIGN Vassilka Kirova Department of Computer & Information Science NJIT.
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 
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter N - 1 Chapter 13 Polymorphism is-a relationships Interfaces.
1 Inheritance and Polymorphism Inheritance (Continued) Polymorphism Polymorphism by inheritance Polymorphism by interfaces Reading for this lecture: L&L.
© Wolfgang Pelz Introduction Object-Oriented Methods: Analysis, Design & Programming Dr. Wolfgang Pelz Dr. Yingcai Xiao The University of Akron.
Object-oriented Programming Concepts
CSE 115 / 503 Introduction to Computer Science For Majors I Carl Alphonce 219 Bell Hall.
Lecture 13: Object- Oriented Concepts Anita S. Malik Adapted from Schach (2004) Chapter 7.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter N - 1 Chapter 13 Polymorphism is-a relationships Interfaces.
2-1 © Prentice Hall, 2004 Chapter 2: Introduction to Object Orientation (Adapted) Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra,
CSE 115 / 503 Introduction to Computer Science I
Object-oriented design CS 345 September 20,2002. Unavoidable Complexity Many software systems are very complex: –Many developers –Ongoing lifespan –Large.
CSCI-383 Object-Oriented Programming & Design Lecture 15.
The Unified Modeling Language (UML) Class Diagrams.
CPT 140 Programming Constructs1 OBJECT ORIENTED TECHNOLOGY Terminology and Basic Concepts.
Introduction To System Analysis and design
1 CSc 131 Computer Software Engineering Fall 2012 Lecture # 7 Object-Oriented Design & UML Class Models.
1 A Student Guide to Object- Orientated Systems Chapter 4 Objects and Classes: the basic concepts.
OBJECT AND CLASES: THE BASIC CONCEPTS Pertemuan 8 Matakuliah: Konsep object-oriented Tahun: 2009.
OBJECT ORIENTED PROGRAMMING CONCEPTS ISC 560. Object-oriented Concepts  Objects – things names with nouns  Classes – classifications (groups) of similar.
Database Management System Prepared by Dr. Ahmed El-Ragal Reviewed & Presented By Mr. Mahmoud Rafeek Alfarra College Of Science & Technology Khan younis.
UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
11 Chapter 11 Object-Oriented Databases Database Systems: Design, Implementation, and Management 4th Edition Peter Rob & Carlos Coronel.
Objected Oriented Programming & Design JAVA Shishir Gupta (704) (704)
Object-Oriented Modeling Chapter 10 CSCI CSCI 1302 – Object-Oriented Modeling2 Outline The Software Development Process Discovering Relationships.
CH06: Considering Objects TECH Computer Science  Set, Class, Type  …of…  Objects, Actors, Agents  Data and Actions Object-Oriented Design and Development.
Object Oriented Programming Principles Lecturer: Kalamullah Ramli Electrical Engineering Dept. University of Indonesia Session-3.
Unified Modeling Language © 2002 by Dietrich and Urban1 ADVANCED DATABASE CONCEPTS Unified Modeling Language Susan D. Urban and Suzanne W. Dietrich Department.
OBJECT-ORIENTED PROGRAMMING (OOP) WITH C++ Instructor: Dr. Hany H. Ammar Dept. of Electrical and Computer Engineering, WVU.
Dale Roberts Object Oriented Programming using Java - Introduction Dale Roberts, Lecturer Computer Science, IUPUI Department.
Object Oriented Analysis: Associations. 2 Object Oriented Modeling BUAD/American University Class Relationships u Classes have relationships between each.
ITEC 3220A Using and Designing Database Systems Instructor: Gordon Turpin Course Website: Office: CSEB3020.
Fundamentals of OO. CSCI 265Dale Roberts Example: Classroom Attending the lecture we have several individuals –Wade - loves Chinese food –George - an.
CSC 131 Fall 2006 Lecture # 6 Object-Oriented Concepts.
CSCI-383 Object-Oriented Programming & Design Lecture 10.
CS451 - Lecture 2 1 CS451 Lecture 2: Introduction to Object Orientation Yugi Lee STB #555 (816) * Acknowledgement:
UMass Lowell Computer Science Java and Distributed Computing Prof. Karen Daniels Fall, 2000 Lecture 9 Java Fundamentals Objects/ClassesMethods Mon.
Chapter 4 Basic Object-Oriented Concepts. Chapter 4 Objectives Class vs. Object Attributes of a class Object relationships Class Methods (Operations)
Chapter 2: Introduction to Object Orientation Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey A.
OO in Context Lecture 13: Dolores Zage. Confused about OO Not alone, there is much confusion about OO many programs are claimed to be OO but are not really.
Banaras Hindu University. A Course on Software Reuse by Design Patterns and Frameworks.
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI Dale Roberts, Lecturer Computer Science, IUPUI
COP 4331 – OOD&P Lecture 7 Object Concepts. What is an Object Programming language definition: An instance of a class Design perspective is different.
 2006 Pearson Education, Inc. All rights reserved Object-Oriented Programming: Polymorphism.
1 Inheritance One of the goals of object oriented programming is code reuse. Inheritance is one mechanism for accomplishing code reuse. It allows us to.
CSCI 383 Object-Oriented Programming & Design Lecture 15 Martin van Bommel.
Java Programming: Guided Learning with Early Objects Chapter 9 Inheritance and Polymorphism.
2-1 © Prentice Hall, 2004 Chapter 2: Introduction to Object Orientation Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph.
Object-oriented programming (OOP) is a programming paradigm using "objects" – data structures consisting of data fields and methods together with their.
UML Diagrams: Class Diagrams The Static Analysis Model
Object-Oriented Analysis and Design
Fundamentals of OO.
Concepts in Object-Oriented Design
Object Oriented Analysis and Design
The Object Paradigm Classes – Templates for creating objects
Presentation transcript:

Concepts in Object-Oriented Design CSCI 240 Dale Roberts, Lecturer Computer Science, IUPUI

CSCI 240Dale Roberts Example: Classroom Attending the lecture we have several individuals –Wade - loves Chinese food –George - an outdoorsman –Wendle - is a sports nut –Lee - doesn't eat anything with a vowel in its name These are the students of our lecture Note that the individuals are not identical. Wade GeorgeWendle Lee

CSCI 240Dale Roberts Abstraction and Classes From our perspective, we see them as an instantiation of a "Class", Student –has a name –attends class –has a grade –completes assignments Note the each student looks the same even though the are different individuals A Class defines an "Abstraction" OO Abstractions are based on –data (name, grade, attendance record) "Attributes" simple access –behavior (completes assignments, attends class) "Operations/Methods" complex properties –relationships (student in course) external implementations

CSCI 240Dale Roberts Objects, Instances of a Class Classes define what properties will exist in each instance Objects provide distinct instances that exhibit those properties George : Student · Name=“George” · Attendence=100% · Current Grade=A Lee : Student · Name=“Lee” · Attendence=85% · Current Grade=B Class Objects Notice that the data members are replicated in each object. Each object is an instance of Student. It does not make sense to replicate member functions.

CSCI 240Dale Roberts Messaging Supports Encapsulation We interact with objects through "messages" Messages allow object to determine implementation rather than the sender determining the implementation for each instance. Messages are passed and handled, rather than invoked like functions.

CSCI 240Dale Roberts Polymorphism Supports Encapsulation Allows an object of any implementation type, which satisfies the interface defined by the abstraction, to be used by a generic reference to an abstraction. Promotes a separation of interface and implementation class GraduateStudent : Student ; float calculateScore(Student s); GraduateStudent George; calculateScore(George) Wade is an undergraduate Student George is an graduate Student Polymorphism says that you can treat both Wade and George as Students if the distinction between undergraduate and graduate is not important.

CSCI 240Dale Roberts Hierarchies Organize lower level abstractions into more complex abstractions Hierarchies allow more complex abstractions to be understood Two basic forms –Inheritance Generalization - Specialization Base Class - Derived Class Parent - Child Abstract Class - Concrete Class –Aggregation (many-to-one relationships) Whole - Part Containership Collection Group

CSCI 240Dale Roberts Inheritance Hierarchy an "is-A" relationship Inheritance –for type - a re-use of common interface –for class - a re-use of common interface and implementation Person · Name Student · Name · Attendence · Current Grade

CSCI 240Dale Roberts Aggregation Hierarchy a "has-A" relationship assembly-part - where the aggregation of parts makes up the whole –ex: airplane is an aggregation of wings, wheels, motor, prop, etc. container-contents - where the container exists with or without contents –ex: classroom is an aggregation of students, instructor, tables, chairs, etc. group-member - where members are logically associated with whole –ex: course has students and teachers as members "weak has-A" - where there is more of a peer-to-peer relationship between abstractions (association) –ex: Instructor has students, Students have instructor

CSCI 240Dale Roberts Comparison of Functional vs. OO Views Register Student Print Transcript Submit Grade Students Grades Student/Grades

CSCI 240Dale Roberts Addition of a New Student Type Changes in data types cause significant impact to functional approaches OO approaches allow new object types to re-define functionality Register Student Print Transcript Submit Grade Students Students/ Pass Fail Students Grades/PF Student/Grades/PF Impact Areas function override

CSCI 240Dale Roberts Addition of New Report Type Changes in functionality based on stable data causes significant impact across objects Functional approaches allow new functions to augment functionality Print Transcript Submit Grade Students Grades Student/Grades/PF Register Student Print Report Card Student/Grades/PF Impact Areas

CSCI 240Dale Roberts Re-organization of OO Abstractions Data dependent behavior handled by derived classes New functionality handled by new associated classes ("wrappers", "adapters", "views")

CSCI 240Dale Roberts UML Sample Package View

CSCI 240Dale Roberts UML Sample Class View Notice that this sample class view does not include visibility indicators. Diamond implies composition: All MediaTopics together comprise a CardCatalog.

CSCI 240Dale Roberts Acknowledgements This presentation is an adaptation of materials developed by Jim Stafford, John Hopkins University. Used by permission.