3 Software Design and Engineering
3 Software Design and Engineering
Archana Vyas
Assistant Professor,
Dept of I.T
DDU
Detailed Syllabus
Reading(s)
Object Modelling Technique
1. Object Modeling Technique OMT [James Rumbaugh 1991] - was
best for analysis and data-intensive information systems.
2. Booch [Grady Booch 1994] - was excellent for design and
implementation.
3. OOSE (Object-Oriented Software Engineering [Ivar Jacobson
1992]) - featured a model known as Use Cases. Use Cases are a
powerful technique for understanding the behavior of an entire
system.
Initially, each had their own development methodology.
Then, UML is developed by the “Three Amigos”: Grady Booch, Jim Rumbaugh, Ivar
Jacobson in 1994-85 at Rational Software.
Object-Oriented System
Development
• OO information system development involves:
– OOA
• Using an OO approach to system analysis
– OOD
• Using an OO approach to system design
– OOP
• Using an OO approach to programming
6
Object-Oriented System Development
• Procedural Approach
– DFD (Data Flow Diagram)
• OOA ( Object Oriented Approach)
– UML
– Blue print of Software
UML
Unified Modelling Language
• Used for designing software.
• Not a programming language.
• The syntax of this language is similar to
natural languages.
• This language represented some symbolic
notation through which we can develop a
design model for software which will be
implemented in future.
UML
Class Diagram Models class structures and content using design elements such as
classes, packages, and objects. It also displays relationships such as
containment, inheritance, associations, and others.
State Diagram Displays the entire sequence of states that an object undergoes in
response to received stimuli, together with the object's responses and
actions
Sequence Diagram Displays the time sequence of the objects participating in the
interaction. This consists of the vertical dimension (time) and
horizontal dimension (different objects).
Collaboration Diagram Displays an interaction organized around the objects and their links to
one another. Numbers are used to show the sequence of messages.
Activity Diagram Displays a special state diagram where most of the states are action
states and most of the transitions are triggered by completion of the
actions in the source states. This diagram focuses on flows driven by
internal processing.
Component Diagram Displays the high-level packaged structure of the code itself.
Dependencies among components are shown, including source code
components, binary code components, and executable components.
Package Diagram Shows how classes can be divided into modules. It also displays the
high-level relationships between packages, of the system, or a specific
subsection.
Deployment Diagram Displays the configuration of run-time processing elements and the
software components, processes, and objects that reside within them.
Understanding OO Development
• OO approach
– System is defined as a collection of objects that
work together to accomplish tasks
• Objects carry out actions when asked
• Each object maintains its own data
• Procedural approach
– System is defined as a set of procedures that
interact with data
• Data is maintained separately from procedures
11
Procedural Versus Object Oriented Approach
12
Example of Object Oriented Programming Language
13
Object Oriented Development
14
Understanding OO Development
• OO Analysis and Design
– Unified Modeling Language (UML)
• Standard OOA&D modeling notation
• Defined by: Grady Booch, James Rumbaugh & Ivar
Jacobson
• Uses model-driven approach:
– Enables creation of graphical models of the system
requirements and system design
15
Understanding OO Development
• OO Analysis and Design
– Unified Modeling Language (UML)
• Components
– Class diagrams
– Use Case diagrams
– Sequence diagrams
– Statecharts
16
17
Understanding OO Development
• OO Analysis and Design
– System Development Life Cycle (SDLC)
• Project management framework that defines project
phases and activities
• Phases:
– Planning
– Analysis
– Design
– Implementation
– Support
18
Understanding OO Development
• OO Analysis and Design
– Prototyping
• Creating a working model of one or more parts of the
system for user evaluation and feedback
– Joint Application Development (JAD)
• Key system stakeholders and decision makers work
together to rapidly define system requirements and
designs
19
Key Object Oriented Concepts
20
Understanding OO Concepts
• Objects, Attributes, and Methods
– Object:
• Attributes
– Characteristics of an object that have values
• Behaviors (or methods)
– Describe what an object can do
• Examples:
– GUI objects
– Problem Domain objects
21
Objects
• Object is an abstraction of something in a
problem domain, reflecting the capabilities of
the system to keep information about it,
interact with it, or both.
• Objects are entities in a software system
which represent instances of real-world and
system entities
22
Objects
23
Object Class
• Class is a description of a set of objects that
share the same attributes, operations,
methods, relationship and semantics.
• Object classes are templates for objects. They
may be used to create objects.
• An object represents a particular instance of a
class.
24
Term of objects
• Attribute: data items that define object.
• Operation: function in a class that combine to
form behavior of class.
• Methods: the actual implementation of
procedure (the body of code that is executed
in response to a request from other objects in
the system).
25
Employee object & class
Class Object
Employee Employee16
27
Attributes and methods in Problem domain objetcs
28
Understanding OO Concepts
• Object Interactions and Messages
– Messages
• The means by which objects interact
• Example:
– User initiates interaction via messages to GUI objects
– GUI objects interact with problem domain objects via
messages
– Problem domain objects interact with each other and GUI
objects via messages
– GUI objects respond to user via messages
29
Object communication
30
Message Passing
message
31
Message Passing
Customer SalesPerson
- numCustomers = 0
- MAX_ PRICE = 200
- MIN_BUDGET = 200
- name: String
- name: String
- employeeNo: String
- address: String
- commission: int
- budget: int
takeOrder
alex lawrence
client server
32
Order Processing System where objects interact by sending messages
33
Message and Method
Understanding OO Concepts
35
Understanding OO Concepts
– Identity
• Unique reference for each object
– Persistent objects
• Defined as available for use over time
36
Encapsulation
private attributes and methods are encapsulated within the
class, they cannot be seen by clients of the class
public methods define the interface that the class provides
to its clients
Customer
- numCustomers = 0
private attributes - MIN_BUDGET = 200
- name: String
- address: String
- budget: int
Customer class
37
Understanding OO Concepts
38
Class Versus objects or instances of the class
39
Understanding OO Concepts
40
Associating objects with other objetcs
41
Objects Association
studies
Student Course
0..* 1..*
42
Object aggregation
43
Object aggregation
Study pack
Course title
Number
Year
Instructor
1 1 1 1
1 1
1 ..* 1 ..*
Exercises Solutions
#Problems Text
Description Diagrams
44
Understanding OO Concepts
45
Inheritance
46
A generalisation hierarchy
Employee
Ma nager Programmer
budgetsControlled project
progLanguage
dateAppointed
47
Library Item
Catalogue Number
Acquisition date
Library class
Cost
Type
hierarchy
Status
Number of copies
Acquire ()
Catalogue ()
Dispose ()
Issue ()
Return ()
Reader Borrower
Affiliation Items on loan
Max. loans
Staff Student
Department Major subject
Department phone Home address
49
Multiple inheritance
50
Multiple inheritance
Book Voice recording
Author Speaker
Edition Duration
Publication date Recording date
ISBN
Talking book
# Tapes
51
Advantages of inheritance
52
Problems with inheritance
• Object classes are not self-contained. they cannot be
understood without reference to their super-classes
• Designers have a tendency to reuse the inheritance
graph created during analysis. Can lead to significant
inefficiency
• The inheritance graphs of analysis, design and
implementation have different functions and should
be separately maintained
53
Inheritance and OOD
54
Superclass and Subclass
55
Understanding OO Concepts
56
Polymorphism for two different types of bank accounts
57
Polymorphism
name
Shape getName( )
calculateArea( )
radius side
Circle Square
calculateArea( ) calculateArea( )
58
Object Cohesion & Coupling
59
Recognizing the Benefits of OO
Development
• Objects are More Natural
– Naturalness
• Based on the fact that people usually think about their
world in terms of objects
• Natural to define the classes of objects involved
• OO vs. procedural
– Which is harder to learn?
60
Recognizing the Benefits of OO
Development
• Classes of Objects can be Reused
– Reuse
• Classes and objects can be invented once and used
many times
– During analysis, design, and programming
• Do not need source code for reused class, simply need
to know interface
61
Learning OO Development
• Introducing Three-Tier Design
– Objects that interact in OO system are separated
into three categories of classes:
• Problem domain classes
– Specific to a particular business application
• GUI classes
– Define objects that make up the UI to the application
• Data access classes
– Work with DBMS to store/retrieve object information
62
OO Analysis and Design
OO Analysis - examines requirements from the perspective of
the classes and objects found in the vocabulary of the
problem domain. In other words, the world (of the system) is
modelled in terms of objects and classes.
63
Object Oriented Analysis
• Analyze the domain problem
• Describe the process systems
• Identify the objects
• Specify attributes
• Defining operations
• Inter-object Communication
64
OO Analysis and Design
Object-Oriented (OO) development is very different
from structured development:
65
Object Oriented Model
66
Structured Model
67
Comparison
OO: Structured:
Systems decomposed into Systems decomposed into
collections of data objects; functions; functions and data
function + data in one place => modelled separately =>
• System components more • System components are more
independent => more resilient dependent on each other =>
to requirements and requirements and
maintenance changes. maintenance changes more
• Inheritance and polymorphism difficult
are possible => reuse, • Inheritance and polymorphism
extension, and tailoring of not possible => limited reuse
software/designs is possible. possible.
• Closely mirrors how humans • System components do not
decompose and solve map closely to real-world
complex. entities => difficult to manage
complexity.
68
Comparison
OO: Structured:
Process allows for iterative and Process less flexible and largely
incremental development => linear =>
• Integration of programs is • Integration of programs is ‘big
series of incremental bang’ effect.
prototypes. • Users or developers provided
• Users and developers get with little or no feedback; see
important feedback system only when it has been
throughout development. completed.
• Testing resources distributed • Testing resources are
more evenly. concentrated in the
• If time is short, coding and implementation stage only.
testing can begin before the • Coding and testing cannot
design is finished. begin until all previous stages
are complete.
69
Why An Object Orientation?
• Higher Level of Abstraction
• Seamless Transition among different phases of
software development
• Encouragement of good programming
techniques
• Promotion of reusability
Unified Approach(UA)
• UA is methodology for software development
that is proposed by the author based on
methodologies by Booch, Rumbaugh and
Jacobson.
• The Unified Modeling Language(UML) is a set
of notations and conventions used to describe
and model an application.