Object Oriented System Analysis and Design (INSY/432)
description
Transcript of Object Oriented System Analysis and Design (INSY/432)
Object Oriented System Analysis and Design (INSY/432)
By Temtim AssefaFebruary 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
• 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
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
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.
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.
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
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.
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.
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.
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
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.
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.
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.
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.
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.
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++.
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.
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 ()
Object Orientation
Enca
psul
atio
n
Abst
ract
ion
Hier
arch
y
Mod
ular
ity
Basic Principles of Object Orientation
Salesperson
Not saying Which salesperson – just a salesperson in general!!!
Customer Product
Manages Complexity
What is Abstraction?
Improves Resiliency
What is Encapsulation?
• Hide implementation from clients– Clients depend on interface
How does an object encapsulate?What does it encapsulate?
Order Processing System
Billing
OrderEntry
OrderFulfillment
Manages Complexity
What is Modularity?
• The breaking up of something complex into manageable pieces
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
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.
Basic Concepts of Object Orientation
• Object• Class• Attribute• Operation• Interface (Polymorphism)• Component• Package• Subsystem• Relationships
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
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
: 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
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
: 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
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
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
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)
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
: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
:CourseOfferingnumber = 101startTime = 900endTime = 1100
:CourseOfferingnumber = 104startTime = 1300endTime = 1500
CourseOfferingnumberstartTime endTime
Class
Attribute
Object
Attribute Value
What is an Attribute?
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.
Messagessender object
attributes:
operations:
receiver object
attributes:
operations:
message: [receiver, operation, parameters]
message: [sender, return value(s)]
38
Manufacturer A Manufacturer B Manufacturer C
OO Principle:Encapsulation
What is Polymorphism?
• The ability to hide many different implementations behind a single interface
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
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
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
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
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
Relationships
• Association– Aggregation– Composition
• Dependency• Generalization• Realization
Professor UniversityWorks for
Class
Association
Association Name
Professor UniversityEmployerEmployee
Role Names
Relationships: Association
• Models a semantic connection among classes
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
Person bodyOrgans
Whole
Aggregation
Part
Relationships: Composition
• A form of aggregation with strong ownership and coincident lifetimes– The parts cannot survive the whole/aggregate
Student Schedule1 0..*
Multiplicity
Navigation
Example: Multiplicity and Navigation
(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?
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.