Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH 1 Object-Oriented Analysis and Design - CDT309 Period 4, Spring 2008 Object-oriented concepts.

Slides:



Advertisements
Similar presentations
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12Slide 1 Software Design l Objectives To explain how a software design may be represented.
Advertisements

Computer Science Dept. Fall 2003 Object models Object models describe the system in terms of object classes An object class is an abstraction over a set.
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall A.1.
Solutions to Review Questions. 4.1 Define object, class and instance. The UML Glossary gives these definitions: Object: an instance of a class. Class:
UML Class Diagram. UML Class Diagrams2 Agenda What is a Class Diagram? Essential Elements of a UML Class Diagram Tips.
L3-1-S1 OO Concepts © M.E. Fayad SJSU -- CMPE Software System Engineering Dr. M.E. Fayad, Professor Computer Engineering Department, Room.
Object-Oriented Databases v OO systems associated with – graphical user interface (GUI) – powerful modeling techniques – advanced data management capabilities.
Chapter Object-Oriented Practices. Agenda Object-Oriented Concepts Terminology Object-Oriented Modeling Tips Object-Oriented Data Models and DBMSs.
1 SWE Introduction to Software Engineering Lecture 23 – Architectural Design (Chapter 13)
Object Oriented System Development with VB .NET
Slide 1 Systems Analysis & Design CS183 Spring Semester 2008 Dr. Jonathan Y. Clark Course Website:
7M701 1 Class Diagram advanced concepts. 7M701 2 Characteristics of Object Oriented Design (OOD) objectData and operations (functions) are combined 
© Copyright Eliyahu Brutman Programming Techniques Course.
Copyright 2004 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Second Edition Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Appendix.
Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH Object-Oriented Analysis and Design - CDT309 Period 4, Spring 2008 Introduction.
Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH 1 Object-Oriented Analysis and Design - CDT309 Period 4, Spring 2008 Design Patterns: someone has already.
Object Oriented Concepts. Movement toward Objects Instead of data-oriented or process-oriented Analysis, many firms are now moving to object-oriented.
UML Class Diagrams: Basic Concepts. Objects –The purpose of class modeling is to describe objects. –An object is a concept, abstraction or thing that.
BACS 287 Basics of Object-Oriented Programming 1.
1 CSc 131 Computer Software Engineering Fall 2012 Lecture # 7 Object-Oriented Design & UML Class Models.
Object Oriented Programming Development
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.
An Object-Oriented Approach to Programming Logic and Design
Copyright 2001 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Appendix A Object-Oriented.
Copyright 2002 Prentice-Hall, Inc. Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich Chapter 20 Object-Oriented.
Database Management System Prepared by Dr. Ahmed El-Ragal Reviewed & Presented By Mr. Mahmoud Rafeek Alfarra College Of Science & Technology Khan younis.
11 Chapter 11 Object-Oriented Databases Database Systems: Design, Implementation, and Management 4th Edition Peter Rob & Carlos Coronel.
Object-Oriented Software Development F Software Development Process F Analyze Relationships Among Objects F Class Development F Class Design Guidelines.
1 Object-Oriented Systems Development Bahrami © Irwin/ McGraw-Hill Chapter 2: Object Basics Object-Oriented Systems Development Using the Unified Modeling.
CS3773 Software Engineering Lecture 04 UML Class Diagram.
7-1 © Prentice Hall, 2004 Chapter 7: Conceptual Data Modeling Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich,
7-1 © Prentice Hall, 2007 Chapter 7: Conceptual Data Modeling Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich,
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 15: Object-Oriented Data Modeling Modern Database Management 9 h Edition Jeffrey A.
Unit 3 Conceptual Data Modeling. Key Concepts Conceptual data modeling process Classes and objects Attributes Identifiers, candidate keys, and primary.
7-1 © Prentice Hall, 2007 Week 5: Conceptual Data Modeling Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich,
CSC480 Software Engineering Lecture 11 September 30, 2002.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 14 Slide 1 Object-oriented Design.
Fall 2010 CS4310 Requirements Engineering A Brief Review of UML & OO Dr. Guoqiang Hu Department of Computer Science UTEP 1.
OBJECT-ORIENTED PROGRAMMING (OOP) WITH C++ Instructor: Dr. Hany H. Ammar Dept. of Electrical and Computer Engineering, WVU.
UML Class Diagram Trisha Cummings. What we will be covering What is a Class Diagram? Essential Elements of a UML Class Diagram UML Packages Logical Distribution.
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.
Object Oriented Analysis & Design Using UML (CS-512) M-Tech CSE (Ist & 3rd Sem) Part Time Mr. Pawan Luthra Assistant Professor (CSE Deptt.) SBSSTC, Ferozepur.
What is a Structural Model?
Kal Bugrara, Ph.DSoftware Engineering Northeastern University Fundamentals Of Software Engineering Lecture V.
What is Object-Oriented?  Organization of software as a collection of discreet objects that incorporate both data structure and behavior.
Object-Oriented Data Modeling
Design Model Lecture p6 T120B pavasario sem.
Programming Paradigms Lecturer Hamza Azeem. What is PP ? Revision of Programming concepts learned in CPLB Learning how to perform “Object-Oriented Programming”
OBJECT ORIENTED AND FUNCTION ORIENTED DESIGN 1 Chapter 6.
CSCI-383 Object-Oriented Programming & Design Lecture 10.
9-Dec Dec-15  INTRODUCTION.  FEATURES OF OOP.  ORGANIZATION OF DATA & FUNCTION IN OOP.  OOP’S DESIGN.
1 Unified Modeling Language, Version 2.0 Chapter 2.
Chapter 4 Basic Object-Oriented Concepts. Chapter 4 Objectives Class vs. Object Attributes of a class Object relationships Class Methods (Operations)
Banaras Hindu University. A Course on Software Reuse by Design Patterns and Frameworks.
OOPS CONCEPT.  OOPS  Benefits of OOPs  OOPs Principles  Class  Object Objectives.
Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall Appendix A Object-Oriented Analysis and Design A.1.
COP 4331 – OOD&P Lecture 7 Object Concepts. What is an Object Programming language definition: An instance of a class Design perspective is different.
Object-oriented programming (OOP) is a programming paradigm using "objects" – data structures consisting of data fields and methods together with their.
Object Oriented Programming
Domain Class Diagram Chapter 4 Part 2 pp
Object Oriented Analysis and Design Using the UML
UML Class Diagram.
Chapter 20 Object-Oriented Analysis and Design
Appendix A Object-Oriented Analysis and Design
ITEC 3220A Using and Designing Database Systems
Basic OOP Concepts and Terms
Object Oriented Analysis and Design
Appendix A Object-Oriented Analysis and Design
Appendix A Object-Oriented Analysis and Design
Presentation transcript:

Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH 1 Object-Oriented Analysis and Design - CDT309 Period 4, Spring 2008 Object-oriented concepts

Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH 2 OOP basic concepts With abstraction, we identify essential features of a system Encapsulation is the packing of information with objects Objects are entities containing data and procedures The methods describe the dynamic behaviour of objects, representing the service they provide Message: a request to execute a method A class is a template for creating objects An instance is an object that belongs to a class With inheritance, we can reuse class specifications A class hierarchy is tree structure showing inheritance relations With polymorphism, we can hide different implementations of a method Independence: an object should be responsible for itself Interfaces describe how users interact with a class

Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH 3 Abstraction Ability to view ”real world” problems with varying degrees of detail

Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH 4 Encapsulation The packaging of several items into one single unit + =

Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH 5 Encapsulation Objects carry with themselves everything they need to perform their function (data and methods in the same entity) Makes it possible to hide information from the outside world

Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH 6 What is an object? Our commonsense concept of an entity with meaning. For example: –Physical entity: a car –Abstract entity: an angel –Conceptual entity: blueprint for an airplane –Software entity: an array

Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH 7 Common properties in objects Boundaries: the object is well defined State: how is it now Behaviour: the object can change state Identity: it has a name

Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH 8 Objects and classes We group objects into classes For example, the classes of airplanes, dogs, people, cars, busses … The objects of a class have common: –properties: all planes have wings, windows, shape… –behaviour: airplanes can fly, turn, land,… –semantics: press the right button to takeoff The buss (object) you took yesterday is an instance of the class of busses

Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH 9 Class: example The class of all courses offered by IDE Attritubes or properties (what kind of information has the object?): name, code, period, shedule,… Operations or behaviour (what can we do with a course?): (un)register a student, assign a lecturer, check if it is full,… What is the semantics?

Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH 10 Sections of a class A class has 3 sections: Course Name Code … Register() Is_full() Lecturer() … First section: the class name Second session: the class attributes Third section: the behaviour of the class (operations or metods)

Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH 11 Relationships between objects Association (aggregation and composition) Dependency Generalization (inheritance)

Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH 12 Association Connection among classes with structural dependence Course Name Code … … University Name Code … … Is given by Association Association name

Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH 13 Association and multiplicity Course Name Code … … University Name Code … … is 1 given by multiplicity Student Name Code … … 1 is 1..5 reading

Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH 14 Association and multiplicity Unspecified Exactly one * 0..* 1 * 2, 4..6 One or more Zero or one Specified range Multiple, disjoint ranges Zero or more (unlimited) }

Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH 15 Association types Aggregation Composition

Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH 16 Dependency relation Connection among classes without structural dependence A client depends on the delevery boy to receive the pizza: but the delivery boy can be changed, and this should not make any difference for the client.

Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH 17 Generalization Hierarchy of abstractions (single and multiple inheritance) ”is-a” relationship A penguin is a bird

Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH 18 Single inheritance Inheritance from one class Superclass Subclasses Generalization relationship

Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH 19 Multiple inheritance Inheritance from more than one class Superclasses Subclass Generalization relationship

Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH 20 What is inherited? A subclass inherits the attibutes, methods and relationships from the superclass And can also –Add additional attibutes, operations, relationships –Redefine inherited methods

Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH 21 Cohesion Tightly coupled systems –Missuse or orveruse of composition –Difficult to change

Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH 22 Cohesion Loosely coupled systems –Missuse or orveruse of inheritance –Difficult to use

Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH 23 Problem You are requested to build a system to help bird researchers to keep track of their birds and observations. What is the most general class?

Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH 24 Inheritance Factor out commonality go to from the general to the specific

Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH 25 Inheritance Generalization-specialization concept: penguins don’t fly! Possible solution: specilize the class into two

Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH 26 Inheritance and encapsulation Inheritance can weaken encapsulation: if you change the superclass, the change is reflected in the hierarchy. What’s the problem here?

Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH 27 Inheritance and encapsulation Subtleties in the ”is-a” relationship: a window in a GUI is much more than a rectangle

Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH 28 Polymorphism Different behaviour for the same message Overloading

Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH 29 Composition Objects can include other objects: a car has an engine, and the engine is itself a separate entity or object

Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH 30 Aggregation and association Aggregation: a car has an engine Association: a computer has a keyboard Can you explain the difference in the relationships in the following diagram?

Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH 31 Dependencies How can we avoid making objects highly dependent when using composition? Mixing domains increase dependency, but can be useful: for example, VCR and DVD player in the same unit

Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH 32 Cardinality of composition The number of objetcs that participate in a composition: –Which objects collaborate with which objects? –How many objects participate in each collaboration? –Is the collaboration optional or mandatory?

Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH 33 More relationships Constructed-with: a stack is constructed with a list Knows-of: a browser knows of which platform it is executing

Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH 34 Cardinality of composition Example: the department offers several courses. Each course must have at least 1 lecturer, and a lecturer can have zero or more children. A course have at most 30 students and at least 10. Draw a class hierarchy for this example How can you represent the cardinality in an implementation language?

Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH 35 Someone was developing an system and came up with the diagram bellow. Explain its meaning based on your knowledge: