Object Oriented System Analysis and Design (INSY/432)

51
Object Oriented System Analysis and Design (INSY/432) By Temtim Assefa February 2014

description

Object Oriented System Analysis and Design (INSY/432) . By Temtim Assefa February 2014. Course Objectives. To explain how a software design may be represented as a set of interacting objects that manage their own state and operations - PowerPoint PPT Presentation

Transcript of Object Oriented System Analysis and Design (INSY/432)

Page 1: Object Oriented System Analysis and  Design (INSY/432)

Object Oriented System Analysis and Design (INSY/432)

By Temtim AssefaFebruary 2014

Page 2: Object Oriented System Analysis and  Design (INSY/432)

Course Objectives

• To explain how a software design may be represented as a set of interacting objects that manage their own state and operations

• To describe the activities in the object-oriented design process

• To introduce various models that can be used to describe an object-oriented design

• To show how the UML may be used to represent these models

Page 3: Object Oriented System Analysis and  Design (INSY/432)

CHAPTER –I Topics

• Definitions and basic concepts (system/software, system thinking..)

• Structured Vs OO approaches• Basic object orientation concepts• Process models (waterfall, Prototyping,

Iterative, RUP)• Work flows (Phases)- in object orientation

Page 4: Object Oriented System Analysis and  Design (INSY/432)

System Concepts - Review What is a system?

A set of interrelated components that work in collaboration to achieve common objectives

System characteristics Purpose, Components, input, output, interfaces, boundary, environment, constraints

Type of SystemLiving Vs Non-livingOpen vs Closed

What is systems thinking?Why we need system thinking?

What is an Information system?A system that generates useful and meaningful information to end users There are different types of IS

4Daniel B.

Page 5: Object Oriented System Analysis and  Design (INSY/432)

Terminologies• Information system and software as products of system

development • System development as a process• Participants and roles in System Development

– Users– Mangers (owners)– Analysts– Designers– Programmers– Consultants

5Daniel B.

Page 6: Object Oriented System Analysis and  Design (INSY/432)

Software development

• It is initiated • by end users

– real problems on the day to day task• By mangers

– Looking for effectiveness and efficiency• By technical personnel

– Sensing new opportunities and technologies

Page 7: Object Oriented System Analysis and  Design (INSY/432)

What is system/software?• Computer programs and associated documentation

such as requirements, design models and user manuals.

• Software products may be developed for a particular customer or may be developed for a general market.

• System products may be– Generic - developed to be sold to a range of different

customers e.g. PC software such as Excel or Word.– Bespoke (custom) - developed for a single customer

according to their specification.

7Daniel B.

Page 8: Object Oriented System Analysis and  Design (INSY/432)

What are the attributes of good system/software?

• The software should deliver the required functionality and performance to the user and should be maintainable, dependable and acceptable.– Maintainability

• Software must evolve to meet changing needs;– Dependability

• Software must be trustworthy;– Efficiency

• Software should not make wasteful use of system resources;– Acceptability (meet users requirement)

• Software must accepted by the users for which it was designed. This means it must be understandable, usable and compatible with other systems.

8Daniel B.

Page 9: Object Oriented System Analysis and  Design (INSY/432)

Software Quality...• Usability

– Users can learn it and fast and get their job done easily• Efficiency

– It doesn’t waste resources such as CPU time and memory• Reliability

– It does what it is required to do without failing• Maintainability

– It can be easily changed• Reusability

– Its parts can be used in other projects, so reprogramming is not needed

9Daniel B.

Page 10: Object Oriented System Analysis and  Design (INSY/432)

Perspectives of System/Software Quality

QUALITY SOFTWARE

Developer: easy to design; easy to maintain;

easy to reuse its parts

User: easy to learn; efficient to use; helps get work done

Customer: solves problems at an acceptable cost in terms of money paid and resources used

Development manager: sells more and pleases customers while costing less

to develop and maintain

10

Page 11: Object Oriented System Analysis and  Design (INSY/432)

Types of system/Software...• Based on application nature

– Custom• For a specific customer

– Generic• Sold on open market• Often called

– COTS (Commercial Off The Shelf)– Shrink-wrapped

– Embedded• Built into hardware• Hard to change

11Daniel B.

Page 12: Object Oriented System Analysis and  Design (INSY/432)

Software Development Life Cycle• SDLC has several clearly defined phases

• Requirements gathering What does the user want?• Systems analysis Understanding/documenting requirements• Design Planning a possible solution• Implementation Building a solution• Testing the implementation Ensuring it meets requirements

• Requirements gathering and systems analysis are performed iteratively.

• Design/Implementation/Testing are done sequentially.

12Daniel B.

Page 13: Object Oriented System Analysis and  Design (INSY/432)

Challenges of System Development

• How well are systems built?– Total Failure 15%– “Challenged” 51%– Successful 34%

• In 1994 Successful System was only 17%!• Challenged means…

– Delayed, budget, or lacking critical features/requirements

13Daniel B.

Page 14: Object Oriented System Analysis and  Design (INSY/432)

System development / Software Engineering Process

• A process used to create a software system• Consists of:

– Methods (steps)• A sequence of step-by-step approaches that help

develop the information system– Techniques

• Processes that the analyst follows to ensure thorough, complete and comprehensive analysis and design

– Tools• Computer programs that aid in applying techniques

14Daniel B.

Page 15: Object Oriented System Analysis and  Design (INSY/432)

Structured Vs Object Oriented Approaches

• Structured paradigm– Modes processes and data separately– Suitable for small sized software

• Object oriented paradigm– Integrates process and data together– Objects are identified as having data and function

15Daniel B.

Page 16: Object Oriented System Analysis and  Design (INSY/432)

Object-oriented development

• Object-oriented analysis, design and programming are related but distinct.

• OOA is concerned with developing an object model of the application domain.

• OOD is concerned with developing an object-oriented system model to implement requirements.

• OOP is concerned with realising an OOD using an OO programming language such as Java or C++.

Page 17: Object Oriented System Analysis and  Design (INSY/432)

Characteristics of OOD• Objects are abstractions of real-world or system entities and

manage themselves.• Objects are independent and encapsulate state and

representation information. • System functionality is expressed in terms of object services.• Shared data areas are eliminated. Objects

communicate by message passing.• Objects may be distributed and may execute

sequentially or in parallel.

Page 18: Object Oriented System Analysis and  Design (INSY/432)

Interacting objects

state o3o3:C3

state o4o4: C4

state o1o1: C1

state o6o6: C1

state o5o5:C5

state o2o2: C3

ops1() ops3 () ops4 ()

ops3 () ops1 () ops5 ()

Page 19: Object Oriented System Analysis and  Design (INSY/432)

Object Orientation

Enca

psul

atio

n

Abst

ract

ion

Hier

arch

y

Mod

ular

ity

Basic Principles of Object Orientation

Page 20: Object Oriented System Analysis and  Design (INSY/432)

Salesperson

Not saying Which salesperson – just a salesperson in general!!!

Customer Product

Manages Complexity

What is Abstraction?

Page 21: Object Oriented System Analysis and  Design (INSY/432)

Improves Resiliency

What is Encapsulation?

• Hide implementation from clients– Clients depend on interface

How does an object encapsulate?What does it encapsulate?

Page 22: Object Oriented System Analysis and  Design (INSY/432)

Order Processing System

Billing

OrderEntry

OrderFulfillment

Manages Complexity

What is Modularity?

• The breaking up of something complex into manageable pieces

Page 23: Object Oriented System Analysis and  Design (INSY/432)

Decreasing abstraction

Increasing abstraction

Asset

RealEstate

Savings

BankAccount

Checking Stock

Security

Bond

Elements at the same level of the hierarchy should be at the same level of abstraction

What is Hierarchy?

• Levels of abstraction

Page 24: Object Oriented System Analysis and  Design (INSY/432)

Advantages of OOD

• Easier maintenance. Objects may be understood as stand-alone entities.

• Objects are potentially reusable components.• For some systems, there may be an obvious

mapping from real world entities to system objects.

Page 25: Object Oriented System Analysis and  Design (INSY/432)

Basic Concepts of Object Orientation

• Object• Class• Attribute• Operation• Interface (Polymorphism)• Component• Package• Subsystem• Relationships

Page 26: Object Oriented System Analysis and  Design (INSY/432)

Truck

Chemical Process

Linked List

What is an Object?• Informally, an object represents an entity, either physical,

conceptual, or software

– Physical entity

– Conceptual entity

– Software entity Linked list

Page 27: Object Oriented System Analysis and  Design (INSY/432)

A More Formal Definition

• An object is a concept, abstraction, or thing with sharp boundaries and meaning for an application

• An object is something that has:– State– Behavior– Identity

Page 28: Object Oriented System Analysis and  Design (INSY/432)

: Professor

Professor Clark

a + b = 10

ProfessorClark : Professor

ProfessorClark

Class Name Only

Object Name Only

Class and Object Name (stay tuned for classes)

Representing Objects

• An object is represented as rectangles with underlined names

Page 29: Object Oriented System Analysis and  Design (INSY/432)

A More Formal Definition

• An object is a concept, abstraction, or thing with sharp boundaries and meaning for an application

• An object is something that has:– State– Behavior– Identity

Page 30: Object Oriented System Analysis and  Design (INSY/432)

: Professor

Professor Clark

a + b = 10

ProfessorClark : Professor

ProfessorClark

Class Name Only

Object Name Only

Class and Object Name (stay tuned for classes)

Representing Objects

• An object is represented as rectangles with underlined names

Page 31: Object Oriented System Analysis and  Design (INSY/432)

OO Principle: Abstraction

What is a Class?

• A class is a description of a group of objects with common properties (attributes), behavior (operations), relationships, and semantics– An object is an instance of a class

• A class is an abstraction in that it:– Emphasizes relevant characteristics– Suppresses other characteristics

Page 32: Object Oriented System Analysis and  Design (INSY/432)

a + b = 10

ClassCourse

PropertiesName

LocationDays offeredCredit hours

Start timeEnd time

BehaviorAdd a student

Delete a studentGet course roster

Determine if it is full

Sample Class

Page 33: Object Oriented System Analysis and  Design (INSY/432)

ProfessornameempID

create( )save( )delete( )change( )

Class Name

Attributes

Operations

Class Compartments

• A class is comprised of three sections– The first section contains the class name– The second section shows the structure

(attributes)– The third section shows the behavior (operations)

Page 34: Object Oriented System Analysis and  Design (INSY/432)

Objects

Class

Professor Smith

Professor Jones

Professor Mellon

Professor

The Relationship Between Classes and Objects

• A class is an abstract definition of an object– It defines the structure and behavior of each

object in the class– It serves as a template for creating objects

• Objects are grouped into classes

Page 35: Object Oriented System Analysis and  Design (INSY/432)

:person name = Kebedeage = 26Sex = malePerson

nameage sex

Class

Attribute

Object

Attribute Value

What is an Attribute?

:person name = Marthaage = 20Sex = Female

Attribute describes a class. It is equivalent to adjective

Page 36: Object Oriented System Analysis and  Design (INSY/432)

:CourseOfferingnumber = 101startTime = 900endTime = 1100

:CourseOfferingnumber = 104startTime = 1300endTime = 1500

CourseOfferingnumberstartTime endTime

Class

Attribute

Object

Attribute Value

What is an Attribute?

Page 37: Object Oriented System Analysis and  Design (INSY/432)

CourseOffering

addStudent deleteStudentgetStartTimegetEndTime

Class

Operation

What is an Operation?

An executable procedure that is encapsulated in a class and is designed to operate on one or more data attributes that are defined as part of the class.A method is invoked via message passing.

Page 38: Object Oriented System Analysis and  Design (INSY/432)

Messagessender object

attributes:

operations:

receiver object

attributes:

operations:

message: [receiver, operation, parameters]

message: [sender, return value(s)]

38

Page 39: Object Oriented System Analysis and  Design (INSY/432)

Manufacturer A Manufacturer B Manufacturer C

OO Principle:Encapsulation

What is Polymorphism?

• The ability to hide many different implementations behind a single interface

Page 40: Object Oriented System Analysis and  Design (INSY/432)

Circle

Pyramid

Cube

Shape

DrawMoveScaleRotate

<<interface>>

Realization relationship (stay tuned for realization relationships)

What is an Interface?

• Interfaces formalize polymorphism• Interfaces support “plug-and-play”

architectures

Page 41: Object Oriented System Analysis and  Design (INSY/432)

Source FileName

<<EXE>>ExecutableName

OO Principle:Encapsulation

What is a Component?

• A non-trivial, nearly independent, and replaceable part of a system that fulfills a clear function in the context of a well-defined architecture

• A component may be – A source code component– A run time components or– An executable component

<<DLL>>ComponentNameComponent

Interface

Page 42: Object Oriented System Analysis and  Design (INSY/432)

Package NameOO Principle:

Modularity

What is a Package?

• A package is a general purpose mechanism for organizing elements into groups

• A model element which can contain other model elements

Page 43: Object Oriented System Analysis and  Design (INSY/432)

OO Principles: Encapsulation and Modularity

<<subsystem>>Subsystem Name

InterfaceInterface

RealizationSubsystem

(stay tuned for realization relationship)

What is a Subsystem?

• A combination of a package (can contain other model elements) and a class (has behavior)

• Realizes one or more interfaces which define its behavior

Page 44: Object Oriented System Analysis and  Design (INSY/432)

ComponentName

Design Model Implementation Model

<<subsystem>>Component Name

Component Interface

Component Interface

OO Principles: Encapsulation and Modularity

Subsystems and Components

• Components are the physical realization of an abstraction in the design

• Subsystems can be used to represent the component in the design

Page 45: Object Oriented System Analysis and  Design (INSY/432)

Relationships

• Association– Aggregation– Composition

• Dependency• Generalization• Realization

Page 46: Object Oriented System Analysis and  Design (INSY/432)

Professor UniversityWorks for

Class

Association

Association Name

Professor UniversityEmployerEmployee

Role Names

Relationships: Association

• Models a semantic connection among classes

Page 47: Object Oriented System Analysis and  Design (INSY/432)

Student Schedule

Whole

Aggregation

Part

Relationships: Aggregation

• A special form of association that models a whole-part relationship between an aggregate (the whole) and its parts

Page 48: Object Oriented System Analysis and  Design (INSY/432)

Person bodyOrgans

Whole

Aggregation

Part

Relationships: Composition

• A form of aggregation with strong ownership and coincident lifetimes– The parts cannot survive the whole/aggregate

Page 49: Object Oriented System Analysis and  Design (INSY/432)

Student Schedule1 0..*

Multiplicity

Navigation

Example: Multiplicity and Navigation

Page 50: Object Oriented System Analysis and  Design (INSY/432)

(continued)

Review: Introduction to Object Orientation

• What are the four basic principles of object orientation? Provide a brief description of each.

• What is an Object and what is a Class? What is the difference between them?

• What is an Attribute?• What is an Operation?• What is an Interface? What is Polymorphism?• What is a Component?

Page 51: Object Oriented System Analysis and  Design (INSY/432)

Review: Introduction to Object Orientation (cont.)

• What is a Package?• What is Subsystem? How does it relate to a

Component? How does it relate to a package? How does it relate to a class?

• Name the 4 basic UML relationships and describe each.• Describe the strengths of object orientation.• Name and describe some general UML mechanisms.• What are stereotypes? Name some common uses of

stereotypes.