COMP1007 Intro to Requirements Analysis © Copyright De Montfort University 2002 All Rights Reserved COMP1007 Intro to Requirements Analysis Object Oriented.

Slides:



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

Solutions to Review Questions. 4.1 Define object, class and instance. The UML Glossary gives these definitions: Object: an instance of a class. Class:
Object-Oriented Analysis and Design
Introduction To System 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.
7M701 1 Software Engineering Object-oriented Design Sommerville, Ian (2001) Software Engineering, 6 th edition: Chapter 12 )
03/12/2001 © Bennett, McRobb and Farmer Class Design Based on Chapter 14 of Bennett, McRobb and Farmer: Object Oriented Systems Analysis and Design.
1 SWE Introduction to Software Engineering Lecture 23 – Architectural Design (Chapter 13)
Intro to Systems Requirements COMP1007 © Copyright De Montfort University 2002 All Rights Reserved COMP1007 Introduction to Systems Requirements Use-Cases.
Fall 2007ACS-1805 Ron McFadyen1 Programming Concepts Chapter 4 introduces more advanced OO programming techniques. Construction of a programs usually requires:
Requirements Analysis 1. 1 Introduction b514.ppt © Copyright De Montfort University 2000 All Rights Reserved INFO2005 Requirements Analysis Objects,
Requirements Analysis 15.1 Specialised Associations b515.ppt © Copyright De Montfort University 2000 All Rights Reserved INFO2005 Requirements Analysis.
Documenting Requirements using Use Case Diagrams
OBJECT ORIENTED ANALYSIS & DESIGN Vassilka Kirova Department of Computer & Information Science NJIT.
Requirements Analysis Classes & Associations b510.ppt © Copyright De Montfort University 2000 All Rights Reserved INFO2005 Requirements Analysis.
COMP1007 Intro to Systems Requirements © Copyright De Montfort University 2002 All Rights Reserved COMP1007 Intro to System Requirements Lecture 2 Use-Cases.
COMP1007 Intro to Systems Requirements © Copyright De Montfort University 2002 All Rights Reserved COMP1007 Intro to Systems Requirements Lecture 4 Identifying.
Requirements Analysis 9. 1 OO Concepts b509.ppt © Copyright De Montfort University 2000 All Rights Reserved INFO2005 Requirements Analysis Object.
Criteria for good design. aim to appreciate the proper and improper uses of inheritance and appreciate the concepts of coupling and cohesion.
IMSE 11 - UML Class Diagrams
Object-oriented Programming Concepts
Requirements Analysis 4. 1 Use Case I b504.ppt © Copyright De Montfort University 2000 All Rights Reserved INFO2005 Requirements Analysis Use-Cases.
Requirements Analysis Classes & Associations b510.ppt © Copyright De Montfort University 2000 All Rights Reserved INFO2005 Requirements Analysis.
03/12/2001 © Bennett, McRobb and Farmer What Is Object-Orientation? Based on Chapter 4 of Bennett, McRobb and Farmer: Object Oriented Systems Analysis.
COMP1007 Introduction to Requirements Analysis © Copyright De Montfort University 2002 All Rights Reserved COMP1007 Introduction to Requirements Analysis.
COMP1007 Intro to Requirements Analysis © Copyright De Montfort University 2002 All Rights Reserved COMP1007 Introduction to Requirements Analysis Lecture.
2-1 © Prentice Hall, 2004 Chapter 2: Introduction to Object Orientation (Adapted) Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra,
Sharif University of Technology Session # 7.  Contents  Systems Analysis and Design  Planning the approach  Asking questions and collecting data 
Introduction To System Analysis and design
Refining the Requirements Model
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 PRACTICAL OBJECT-ORIENTED DESIGN WITH UML 2e Chapter 2: Modelling.
BCS 2143 Introduction to Object Oriented and Software Development.
OBJECT ORIENTED PROGRAMMING CONCEPTS ISC 560. Object-oriented Concepts  Objects – things names with nouns  Classes – classifications (groups) of similar.
Slide 1 UML Review Chapter 2: Introduction to Object-Oriented Systems Analysis and Design with the Unified Modeling Language, Version 2.0 Alan Dennis,
Database Management System Prepared by Dr. Ahmed El-Ragal Reviewed & Presented By Mr. Mahmoud Rafeek Alfarra College Of Science & Technology Khan younis.
Unified Modeling Language, Version 2.0
What Is Object-Orientation?
1 Object orientation. 2 What benefits does OO give? Primarily –Encapsulation (Associates data & operations) –Types & specialisation –Software re-use.
Introduction To System Analysis and Design
11 Chapter 11 Object-Oriented Databases Database Systems: Design, Implementation, and Management 4th Edition Peter Rob & Carlos Coronel.
Object Oriented System Software Engineering. Object Oriented Analysis & Design - 1 Everything is a class class is a blueprint, abstract object has identity,
03/12/2001 © Bennett, McRobb and Farmer 2005 Refining the Requirements Model Based on Chapter 8 of Bennett, McRobb and Farmer: Object Oriented Systems.
Slide 1 Systems Analysis and Design With UML 2.0 An Object-Oriented Approach, Second Edition Chapter 2: Introduction to Object-Oriented Systems Analysis.
What is Object-Oriented?  Organization of software as a collection of discreet objects that incorporate both data structure and behavior.
Object Oriented Software Development
Object-Oriented Modeling: Static Models. Object-Oriented Modeling Model the system as interacting objects Model the system as interacting objects Match.
CS451 - Lecture 2 1 CS451 Lecture 2: Introduction to Object Orientation Yugi Lee STB #555 (816) * Acknowledgement:
Internet and Intranet Protocols and Applications Lecture 5a: HTTP Client-Server Design and Implementation February 15, 2005 Arthur Goldberg Computer Science.
Slide 1 Systems Analysis and Design With UML 2.0 An Object-Oriented Approach, Second Edition Chapter 2: Introduction to Object-Oriented Systems Analysis.
1 Unified Modeling Language, Version 2.0 Chapter 2.
OOP Review CS 124.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
CMSC 345 Fall 2000 OO Design. Characteristics of OOD Objects are abstractions of real-world or system entities and manage themselves Objects are independent.
04 - OOD Intro.CSC4071 Software Design ‘Requirements’ defines –The goals the system needs to satisfy. ‘Specification’ defines –The externally-observable.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
COP 4331 – OOD&P Lecture 7 Object Concepts. What is an Object Programming language definition: An instance of a class Design perspective is different.
Lecture 2 Intro. To Software Engineering and Object-Oriented Programming (2/2)
Basic Characteristics of Object-Oriented Systems
Slide 1 Unified Modeling Language, Version 2.0 Object-Oriented SAD.
Object-Oriented Programming
Systems Analysis and Design With UML 2
OOP What is problem? Solution? OOP
Systems Analysis and Design With UML 2
Object Oriented Concepts -I
Object-Oriented Programming
SNSCT_CSE_PROGRAMMING PARADIGM_CS206
What Is Object-Orientation?
Refining the Requirements Model
Presentation transcript:

COMP1007 Intro to Requirements Analysis © Copyright De Montfort University 2002 All Rights Reserved COMP1007 Intro to Requirements Analysis Object Oriented Concepts Department of Information Systems

COMP1007 Intro to Requirements Analysis © Copyright De Montfort University 2002 All Rights Reserved Learning Objectives v Why OO? v Classes & Objects v Review the UML notation v Some important concepts in OO –message passing –encapsulation –inheritance –polymorphism

COMP1007 Intro to Requirements Analysis © Copyright De Montfort University 2002 All Rights Reserved Why OO? v Easier maintenance & extensibility of software v Supports reuse of existing software v Handles complexity well v Natural modelling (i.e. descriptions) of problem domain v Requirements traceability

COMP1007 Intro to Requirements Analysis © Copyright De Montfort University 2002 All Rights Reserved Objects An object is “a concept, abstraction or thing with crisp boundaries and meaning for the problem at hand.” Rumbaugh et al., 1991 An object reflects “the capabilities of a system to keep information [or] to interact” Coad and Yourdon, 1991 An object has “ state, behaviour and identity ” Booch, 1993 An object “represents a particular instance of a class. It has identity and attribute values” UML Spec V1.1

COMP1007 Intro to Requirements Analysis © Copyright De Montfort University 2002 All Rights Reserved Object State v Static and dynamic attributes v State is reflected by attribute values v A car object…. u make u model u mileage u dateRegistered u dateTaxed u dateTested Registered / Unregistered Taxed / Untaxed Tested / Untested may have states:

COMP1007 Intro to Requirements Analysis © Copyright De Montfort University 2002 All Rights Reserved Object Behaviour v We associate valid behaviour (operations) with each object v For the car object –register –tax –changeColour? v Each valid operation is invoked by a request from another object

COMP1007 Intro to Requirements Analysis © Copyright De Montfort University 2002 All Rights Reserved Object Identity v Object identity is intrinsic, not necessarily reflected by attribute values v Referenced by an object-id v Cars have different registrations but the registration is not the object id

COMP1007 Intro to Requirements Analysis © Copyright De Montfort University 2002 All Rights Reserved Classes Class describes “a group of objects with –similar properties (attributes) –common behaviour (operations) –common relationships to other objects (associations) –common semantics” Rumbaugh et al., 1991 Class is “a descriptor for a set of objects with similar structure & behaviour” UML V1.1

COMP1007 Intro to Requirements Analysis © Copyright De Montfort University 2002 All Rights Reserved Classification v Grouping objects with the same behaviour and data. v Modifying or Extending the object – modify existing behaviour – add further attributes or properties v Example – a savings account is a special type of account which pays interest on the balance and cannot be overdrawn

COMP1007 Intro to Requirements Analysis © Copyright De Montfort University 2002 All Rights Reserved Class Window {abstract, author=Ray, status=tested} +size:Area = (50,50) #visibility:Boolean=invisible +default-size:Rectange #maximum-size:Rectangle -xptr:XWindow* +display() +create() -attachXWindow(xwin:XWindow*) Window size:Area visibility:Boolean display() Implementation Detail Suppressed Analysis Level

COMP1007 Intro to Requirements Analysis © Copyright De Montfort University 2002 All Rights Reserved Message Passing v Objects collaborate to achieve the functional requirements v Objects communicate by passing messages –request another object to do something – calls an operation in the receiving object –may include parameters = data needed by the called operation –some messages have return values = a result of the operation

COMP1007 Intro to Requirements Analysis © Copyright De Montfort University 2002 All Rights Reserved Message Passing Borrower address name status Book status title borrow The borrower object sends a message to the book object The message calls the borrow operation. Result: Book.status is updated to “onLoan”. This change of attribute value also represents a state change for the book object.

COMP1007 Intro to Requirements Analysis © Copyright De Montfort University 2002 All Rights Reserved Encapsulation

COMP1007 Intro to Requirements Analysis © Copyright De Montfort University 2002 All Rights Reserved Encapsulation v An object has data and behaviour v Behaviour = operations that access the data v Data should be accessed only by object’s own operations v Operation signature specifies number and type of attributes passed to it

COMP1007 Intro to Requirements Analysis © Copyright De Montfort University 2002 All Rights Reserved Effect of Encapsulation v Object implementation hidden from other objects, though they may use its operations v Other objects see only operation protocols v Internal details may change significantly— no effect on rest of system v As long as operation purpose and protocol stay the same, changes don’t “ripple”

COMP1007 Intro to Requirements Analysis © Copyright De Montfort University 2002 All Rights Reserved v But we want to distinguish academic and admin staff v E.g. admin staff can’t be assigned to teaching v We specialise the StaffMember base class Generalisation-Specialisation v Say we have a general Staff class:

COMP1007 Intro to Requirements Analysis © Copyright De Montfort University 2002 All Rights Reserved Generalisation-Specialisation

COMP1007 Intro to Requirements Analysis © Copyright De Montfort University 2002 All Rights Reserved Generalisation-Specialisation  Instances of AdminStaff and AcademicStaff all have name, address, phone, nextOfKin attributes v (from generalised StaffMember class)  AcademicStaff also has specialised associations with Module

COMP1007 Intro to Requirements Analysis © Copyright De Montfort University 2002 All Rights Reserved Inheritance v An example of inheritance v Gives opportunities for reuse v Minimises duplication of effort v Derived classes inherit base class reliability v Don’t violate base class encapsulation

COMP1007 Intro to Requirements Analysis © Copyright De Montfort University 2002 All Rights Reserved Inheritance  Subclasses redefine the operation pay  (signature stays the same) v Sender of message need not know class of receiving object v Inheritance allows reuse of existing class definitions v Just add extra attributes or modify behaviour as required

COMP1007 Intro to Requirements Analysis © Copyright De Montfort University 2002 All Rights Reserved Polymorphism  Redefinition of pay operation is example of polymorphism v Same pay message can be sent to many StaffMember objects v Each uses its own pay method depending upon class: –AcademicStaff or AdminStaff

COMP1007 Intro to Requirements Analysis © Copyright De Montfort University 2002 All Rights Reserved Summary v 4 important characteristics of OO: –message passing –encapsulation –inheritance –polymorphism

COMP1007 Intro to Requirements Analysis © Copyright De Montfort University 2002 All Rights Reserved References v Bennett, S., McRobb, S. & Farmer, R. Object-Oriented Systems Analysis and Design using UML McGraw-Hill 1999 v Jacobson, I., Booch, G. and Rumbaugh, J. (1999), The Unified Software Development Process, Addison-Wesley, Reading Mass. v Rational Unified Process 2000