Object-Oriented Analysis

Slides:



Advertisements
Similar presentations
Week 2 The Object-Oriented Approach to Requirements
Advertisements

Requirements Diagrams With UML Models
Karolina Muszyńska Based on:
© 2006 ITT Educational Services Inc. SE350 System Analysis for Software Engineers: Unit 9 Slide 1 Appendix 3 Object-Oriented Analysis and Design.
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall A.1.
Object-Oriented Analysis and Design
Chapter 22 Object-Oriented Systems Analysis and Design and UML Systems Analysis and Design Kendall and Kendall Fifth Edition.
Objectives Detailed Object-Oriented Requirements Definitions
Ch 12: Object-Oriented Analysis
Object-Oriented Analysis and Design
Objectives Explain how events can be used to identify use cases that define requirements Identify and analyze events and resulting use cases Explain how.
Introduction To System Analysis and Design
Systems Analysis and Design in a Changing World, Fourth Edition
©Ian Sommerville 2006Software Engineering, 8th edition. Chapter 8 Slide 1 System models.
© 2005 Prentice Hall4-1 Stumpf and Teague Object-Oriented Systems Analysis and Design with UML.
Object-Oriented Databases
Modified from Sommerville’s originalsSoftware Engineering, 7th edition. Chapter 8 Slide 1 System models.
Copyright 2004 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Second Edition Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Appendix.
7. 2Object-Oriented Analysis and Design with the Unified Process Objectives  Detailed Object-Oriented Requirements Definitions  System Processes—A Use.
Systems Analysis and Design in a Changing World, 6th Edition
Objectives Explain the purpose and objectives of object- oriented design Develop design class diagrams Develop interaction diagrams based on the principles.
Overview Objective: refine information gathered
2Object-Oriented Analysis and Design with the Unified Process Events and Use Cases  Use case  Activity the system carries out  Entry point into the.
Detailed Object-Oriented Requirements Definitions
Introduction to Software Design Chapter 1. Chapter 1: Introduction to Software Design2 Chapter Objectives To become familiar with the software challenge.
Object-Oriented Analysis and Design
Chapter 7: The Object-Oriented Approach to Requirements
System Analysis Overview Document functional requirements by creating models Two concepts help identify functional requirements in the traditional approach.
Chapter 5: Modeling Systems Requirements: Events and Things
Introduction To System Analysis and design
Systems Analysis and Design in a Changing World, Tuesday, Feb 27
Systems Analysis and Design in a Changing World, Fifth Edition
Chapter 4 System Models A description of the various models that can be used to specify software systems.
Detailed Object-Oriented Requirements Definitions
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.
5 Systems Analysis and Design in a Changing World, Fourth Edition.
Objectives Detailed Object-Oriented Requirements Definitions
The Object-Oriented Approach to Requirements
4 2009/10 Object Oriented Technology 1 Topic 4: The Object-Oriented Approach to Requirements Adopted from: Ch.7 The Object-Oriented Approach to Requirements.
Systems Analysis and Design in a Changing World, Fifth Edition
Systems Analysis and Design in a Changing World, 6th Edition
11 Chapter 11 Object-Oriented Databases Database Systems: Design, Implementation, and Management 4th Edition Peter Rob & Carlos Coronel.
Systems Analysis and Design in a Changing World, 3rd Edition
Sommerville 2004,Mejia-Alvarez 2009Software Engineering, 7th edition. Chapter 8 Slide 1 System models.
Objectives Explain how events can be used to identify use cases that define requirements Identify and analyze events and resulting use cases Explain.
7 Systems Analysis and Design in a Changing World, Fifth Edition.
5 Systems Analysis and Design in a Changing World, Fifth Edition.
Use Case Driven Analysis Requirements Use Case Use Case Description System Sequence Diagram Chapter 5.
ITEC 3220A Using and Designing Database Systems Instructor: Prof Z. Yang Course Website: 3220a.htm
Object-Oriented Modeling: Static Models. Object-Oriented Modeling Model the system as interacting objects Model the system as interacting objects Match.
ITEC 3220A Using and Designing Database Systems Instructor: Gordon Turpin Course Website: Office: CSEB3020.
Systems Analysis and Design in a Changing World, 6th Edition 1 Chapter 5 INTRODUCTION TO SYSTEMS ANALYSIS AND DESIGN: AN AGILE, ITERATIVE APPROACH CHAPTER.
7. 2Object-Oriented Analysis and Design with the Unified Process Objectives  Detailed Object-Oriented Requirements Definitions  System Processes—A Use.
12 Chapter 12: Advanced Topics in Object-Oriented Design Systems Analysis and Design in a Changing World, 3 rd Edition.
Systems Analysis and Design in a Changing World, Fourth Edition
Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall Appendix A Object-Oriented Analysis and Design A.1.
7 Systems Analysis – ITEC 3155 The Object Oriented Approach – Use Cases.
1 7 Systems Analysis and Design in a Changing World, 2 nd Edition, Satzinger, Jackson, & Burd Chapter 7 The Object-Oriented Approach to Requirements.
5 Systems Analysis and Design in a Changing World, Fourth Edition.
Systems Analysis and Design in a Changing World, Fourth Edition
Appendix 3 Object-Oriented Analysis and Design
DATA REQIREMENT ANALYSIS
The Movement To Objects
Business System Development
Chapter 20 Object-Oriented Analysis and Design
Appendix A Object-Oriented Analysis and Design
ITEC 3220A Using and Designing Database Systems
Appendix A Object-Oriented Analysis and Design
Presentation transcript:

Object-Oriented Analysis

Traditional and OO Approach

Object -Oriented = Object + Class + Inheritance Object-orientation is an engineering principle used to create a representation of the real-world problem domain and to map it into a software solution domain

Object-Oriented Concepts Figure 11.7 OO Summary: Object Characteristics 25

Object An object is an abstract representation of a real-world entity that has a unique identity, embedded properties, and the ability to interact with other objects and itself. In object -oriented approach, any real-world entity must be uniformly modeled as an object Examples of object: user, account, machine, window, mouse, game character…

Object Each object consists of three parts: Object identifier -- uniquely identifies the object State (Properties) -- Set of values specifying the attributes of the object Behavior (Methods) -- The set of methods (program code) that operate on the state of the object

Object Identifier (OID) Objects can have a unique identity (OID) independent of the values that they contain Is not the same as key Automatically created by the system References an object elsewhere: in association with another object or in an application program Usually is not visible to user Improves efficiency of access

Attributes Objects are described by their attributes, referred to as Instance variables Each attribute has a unique name and a data type associated to it. Base or conventional data type (real, integer, ..etc), Abstract data type (ADT). Object attributes may reference one or more other objects At the implementation level, the OID of the referenced object is used to link both objects

An example of Object Oriented Approach Account Owner -------------------- Name Address Account owned --------------------- -Open Account request -Close Account -Found transfer Account -------------------- Account number Account owner Balance Rate --------------------- -Deposit -Withdraw -Check Saving account -------------------- Super class: Account --------------------- -Check Error message to Account Owner Bonus Savings -------------------- Super class: Savings --------------------- Period Deposit date -Withdraw Check maturity Checking account -------------------- Super class: Account ---------------------

Methods Every operation to be performed on an object must be implemented by a method Methods are used to change the object’s attribute values or to return the value of selected object attributes Methods represent the object’s behavior Every method is identified by a name and has a body

Message Objects, classes and their instances communicate with each other by message passing. The state and behavior encapsulated in an object can only be accessed or invoked from outside the object through an explicit message. The ability to hide the object’s internal details (attributes and methods) is known as encapsulation

An example of Object Oriented Approach Account Owner -------------------- Name Address Account owned --------------------- -Open Account request -Close Account -Found transfer Account -------------------- Account number Account owner Balance Rate --------------------- -Deposit -Withdraw -Check Saving account -------------------- Super class: Account --------------------- -Check Error message to Account Owner Bonus Savings -------------------- Super class: Savings --------------------- Period Deposit date -Withdraw Check maturity Checking account -------------------- Super class: Account ---------------------

Practice: A fitness center service system

Identify the Classes in a fitness center Name ? Attributes ? Methods ?

Class A class is a collection of similar objects with shared structure (attributes ) and behavior (methods). The class defines the attributes and procedures; the objects are the instances of the class definition The domain (type) of a class’ attribute can be a class in itself.

Class Hierarchy Class hierarchy (“is a” relation) -- All the classes must be organized into a rooted directed acyclic graph or a hierarchy A class inherits all the attributes and methods from its immediate and remote ancestors

Class Hierarchy The class hierarchy must be dynamically extensible; that is, new sub-classes can be derived from one or more existing classes (allow more than one superclasses) Class-composition hierarchy (“has” relation) -- The aggregation relationship between a class and its attributes (the domain of an attribute can be a class)

Inheritance Inheritance is the innate ability of an object within the hierarchy to inherit the data structure and behavior of the classes above it. It is through inheritance that OO system can deliver code reusability

An example of Object Oriented Approach – Class Hierarchy Account -------------------- Account number Account owner Balance Rate --------------------- -Deposit -Withdraw -Check Saving account -------------------- Super class: Account --------------------- -Check Error message to Account Owner Bonus Savings -------------------- Super class: Savings --------------------- Period Deposit date -Withdraw Check maturity Checking account -------------------- Super class: Account ---------------------

The Essence of Object-Orientation Classification -- The ability to group associated objects according to common properties. Encapsulation -- The grouping together of various properties associated with an identifiable entity (the object) to which access is restricted by a well-defined interface. Flexible sharing -- The ability for an object to belong to more than one classification. Interpretation -- The resolution of the precise semantics of the shared item of behavior (Polymorphism)

UML: Object-Oriented Modeling Standard Object-oriented modeling notation is Unified Modeling Language (UML 2.0) UML was accepted by Object Management Group (OMG) as standard modeling technique Purpose of Object Management Group Promote theory and practice of object-oriented technology for development of distributed systems Provide common architectural framework for OO

http://atlas. kennesaw. edu/~dbraun/csis4650/A&D/UML_tutorial/index http://atlas.kennesaw.edu/~dbraun/csis4650/A&D/UML_tutorial/index.htm

UML Diagrams

Object-Oriented Requirements Modeling Object-oriented system requirements are specified and documented through process of building models Modeling process starts with identification of use cases and problem domain classes (things in users’ work environment) Business events trigger elementary business processes (EBP) that new system must address as use cases Use cases define functional requirements

Traditional and OO Approach

Relationships Between OO Requirements Models

The Class Diagram Domain model class diagram Design class diagram Models things in the users’ work domain Used to define requirements for OO (very similar to entities in ERD) Design class diagram Models software classes Adds methods as behaviors Used in the design activity

UML Class Symbol

Multiplicity of Associations

Expanded Course Enrollment Design Class Diagram

Object-Oriented Requirements Models Use case diagrams – identify actors and their use cases (goals) Use case descriptions – include details of a use case and how actors use the system Systems sequence diagrams (SSDs) – define inputs and outputs and sequence of interactions between user and system for a use case Activity diagrams – describe user and system activities for a use case State machine diagrams – describe states of each object

The System Activities— A Use Case/Scenario View Use case analysis used to identify and define all business processes that system must support Use case – an activity a system carried out, usually in response to a user request Actor Role played by user Outside automation boundary

Simple Use Case with an Actor

Techniques for Identifying Use Cases Identify user goals Each goal at the elementary business process (EBP) level is a use case EBP – task performed by one user in one place and in response to business event that adds measurable business value, and leaves system and data in consistent state Event decomposition technique (event table) CRUD analysis technique (create, read/report, update, delete) to ensure coverage

Information about Each Event in an Event Table

Use Case Diagram Graphical UML diagram that summarizes information about actors and use cases Simple diagram shows overview of functional requirements Can have multiple use case diagrams By subsystem By actor

Use Case Diagram with Automation Boundary and Alternate Actor Notation

Use Cases of an Order Entry Subsystem

<<Includes>> Relationship Documents situation in which one use case requires the services of a common subroutine Another use case is developed for this common subroutine A common use case can be reused by multiple use cases

Example of Order-Entry Subsystem with <<Includes>> Use Cases

CRUD Analysis for Identifying/Confirming Use Cases CRUD – create, read/report, update, delete Information Engineering (IE) technique to identify event table or directly develop use case diagram Compares identified use cases with domain model class diagram Every class in class diagram must have use cases to support creating, reading, reporting, updating, and deleting object instances Confirms system integration requirements

Use Case Description Use case description provides details of preconditions, postconditions, sequence of activities, and exception conditions in use case Describes actor interacting with computer system step-by-step to carry out business activity May have several scenarios for a use case, each a specific use case instance Three levels of detail: brief, intermediate, and fully developed description Many analysts prefer to write narrative descriptions of use cases instead of drawing activity diagrams

Brief Description of Create New Order Use Case

Use Case Description Components Use case name/scenario name Actors/stakeholders Related use cases Preconditions – set of criteria that must be true prior to initiation of the use case Postconditions – set of criteria that must be true upon completion of the use case Flow of activities (steps in one column or two) Exception conditions

Fully Developed Use Case Description

Practice Describe a use case of searching house

Activity Diagrams Used to document workflow of business process activities for each use case or scenario Can support any level of use case description; a supplement to use case descriptions Helpful in developing system sequence diagrams

Activity Diagram: Telephone Order Scenario

Activity Diagram: Web Order Scenario

Practice Draw a activity diagram for a landlord register and enter housing advertisement.

Identifying Inputs and Outputs— The System Sequence Diagram System sequence diagram (SSD) is type of UML 2.0 interaction diagram Used to model input and output messaging requirements for a use case or scenario Shows actor interacting with system Shows sequence of interactions as messages during flow of activities System is shown as one object: a “black box”

Sequence Diagram

System Sequence Diagram (SSD) Notation

Repeating Message

Developing a System Sequence Diagram Begin with detailed description of use case from fully developed form or activity diagram Identify input messages Describe message from external actor to system using message notation Identify and add any special conditions on input message, including iteration and true/false conditions Identify and add output return messages

Activity Diagram and Resulting SSD for Telephone Order Scenario

SSD of the Web Order Scenario for the Create New Order Use Case

Identifying Object Behavior— The State Machine Diagram State machine diagram is UML 2.0 diagram that models object states and transitions Complex problem domain classes can be modeled State of an object A condition that occurs during its life when it satisfies some criterion, performs some action, or waits for an event Each state has unique name and is a semipermanent condition or status Transition The movement of an object from one state to another state

Simple State Machine Diagram for a Printer

State Machine Diagram is also called as State Transition Diagram

State Machine Terminology Pseudo state – the starting point of a state machine, indicated by a black dot Origin state – the original state of an object from which the transition occurs Destination state – the state to which an object moves after the completion of a transition Message event – the trigger for a transition, which causes the object to leave the origin state Guard condition – a true/false test to see whether a transition can fire Action expression – a description of the activities performed as part of a transition

State Machine Diagram for OrderItem Problem Domain Class

Rules for Developing State Machine Diagram Review domain class diagram, select important ones, and list all state and exit conditions Begin building state machine diagram fragments for each class Sequence fragments in correct order and review for independent and concurrent paths Expand each transition with message event, guard-condition, and action-expression Review and test each state machine diagram

First-Cut State Machine Diagram for Order

Second-Cut State Machine Diagram for Order

Integrating Object-Oriented Models Complete use case diagram is needed to understand total scope of new system Domain model class diagrams should also be as complete as possible for entire system With iterative approach, only construct use case descriptions, activity diagrams, and system sequence diagrams for use cases in iteration Development of a new diagram often helps refine and correct previous diagrams

Summary Object-oriented approach has complete set of diagrams that define system requirements Requirements specified using following models Domain model class diagram Use case diagrams Use case detailed models, either descriptive formats or activity diagrams System sequence diagrams State machine diagrams