Library can have library items the library items contains Borrowable items and NonBorrowableItems.the Book and CD are Borrowable items journal is a no
Ooad content of unit vi
Subject: Object Oriented Analysis and Design
B.Tech III Year II-Semester
Computer Science &Engineering
Table of Contents
Unit-VI: Interfaces and components
• Design a Subsystem
• What is an Interface
• Provided and Required Interfaces
• Interface realization vs. inheritance, Ports
• What is a Component, component stereotypes
• Advantages and disadvantages of interfaces
• Use case realization design
• Interaction diagrams in design
• Subsystem interactions
• Timing diagrams
At the end of this unit the student will be in a position to:
• Model applications using Interfaces and components
• Design the Subsystem
• Understand the design workflow
• Understand the principles of Interfaces and Components
• Understand the advantages and disadvantages of Interfaces
• Understand the Types and roles of interfaces
• Understand Contents, common properties and uses of the
• Understand the Properties of a well-structured component
Design a Subsystem
A Subsystem is a special type of component, it is a grouping of elements.
The Component Engineer in the design workflow will design a subsystem, by taking
Architecture description, outlined subsystem and outlined interface as inputs.
• The activity design a subsystem is about decomposing the system into a collection
• Interaction between Subsystems are mediated by interfaces
What is an Interface?
A collection of operations that are used to specify a service of a class or a component
The attributes and operations in an interface should include
• The complete operation signature (name, type of all parameters, and return
• The semantics of the operation
• The name and type of the attributes
• Any operation or attribute stereotypes, constraints and tagged values
Provided and required interfaces
• The set of interfaces realized by a classifier is known as its provided interfaces
• When a classifier requires one or more interfaces for its operation, these are
known as its required interfaces.
Interface realization vs. Inheritance
Interface realization: “realizes a contract specified by”
Inheritance: “is a” relationship
The substitutability principle applies both for inheritance and for interface realization.
“Class” style notation
“Lollipop” style notation
BorrowableItem NonBorrowable Item
Example: Here the interface
realization is converted into inheritance
Library can have library items the
library items contains Borrowable
and NonBorrowableItems. the Book
and CD are Borrowable items
journal is a NonBorrowableItem.
A port graps a set of provided and required interfaces.
It indicates a specific point of interaction between a classifier and its environment
Ports are a very useful way of structuring a classifier’s provided and required
A viewer class that connects
to the presentation port of
the Book class
Ports may have a visibility
Interfaces and component based development
Interfaces are the key to component-based development. This is about
constructing software from plug –in parts.
A physical and replaceable part of a system that conforms to and provides the
realization of a set of interfaces
Components can have attributes and operations and can participate in
association and generalization relationships.
Components can represent something that can be instantiated at runtime, such
as an EJB (Enterprise Java Bean).
A component may be manifest by one or more artifacts
An artifact represents something in the physical world, such as a source file
Types of Components
Three kinds of Components
Deployment Component: These are the components necessary and sufficient
to form an executable system. such as dynamic libraries (DLLs) and
Work product Component: These components do not directly participate in an
executable system but are the work products of development that are used to
create the executable system
Execution Component: These artifacts are created as a consequence of an
executing system, which is instantiated from DLL.
<<build Component>> A Component that defines a set of things
for organizational or System-level
<<process>> A transaction-based Component
<<service>> Functional Component that Computes
<<SubSystem>> A unit of hierarchical decomposition for
• A system decomposed into a collection of Sub Systems
• Subsystem is a set of elements organized to accomplish a purpose and
described by a set of models
• A Sub System is a grouping of elements
• The primary relationship between a system and its subsystem is Composition.
• A system may contain zero or more Sub Systems.
Systems and subsystems
Interfaces can be found in a system by
• Challenge each association
• Challenge each message send
• Factor out groups of reusable operations
• Factor out groups of repeating operations
• Factor out groups of repeating attributes
• Look for classes that play the same role in the system
• Look for responsibilities for future expansion
• Look for dependencies between components
Advantages of interfaces
Designing with interfaces allows you to reduce the number of dependencies
between classes, Subsystems and Components
Appropriate use of interfaces can help reduce coupling
Disadvantages of Interfaces
Using interfaces increases in complexity.
Design a Use Case
Is about finding the design classes, interfaces and components.
Use case model
Use case realization-design
Use case Engineer
Design a use case
Inputs to Design a Use case
• Use case model
• Requirements model
• Analysis model
• Design model
• Deployment model
Outputs to Design a Use case
• Use case realization Design
• Design Classes [outlined]
• Subsystem [outlined]
• Interface [outlined]
Use case realization-design
o Describes how a particular use case is realized within the design model, in
terms of collaborating objects.
o Specifies implementation decisions and realizes the non-functional
o Is an organization model element used to group a number of artifacts related
to the design of a Use case
Use case realization-design consist of
Class diagrams: that depict its participating analysis classes
Interaction diagrams: that depict the realization of a particular flow of the
Interaction diagrams in design
• Interaction diagrams are key part of use case realization design.
• There are two types of interaction diagrams
i) Sequence diagrams: shows the explicit sequence of messages
ii) Communication diagrams: shows the communication links between objects
Sequence diagram : show the objects participating in the interaction by their
“lifelines” and the messages that they send to each other.
Example: sequence diagram of Add Course use case in University registration system
Communication/collaboration diagram: Shows the relationships among the
Example: Communication diagram of Add Course use case in URS
can show the interactions between parts of the system
• This is a type of interaction diagram that focuses on modeling timing
• The timing diagram is a very simple diagram.
• Time increases horizontally from left to right, and lifelines and their states
are shown vertically
Timing diagram for siren class
State or condition
. . . . .:
•Timing diagrams are used to show how an object changes state over time.
•In the fig The :siren object only responds to intruder events when it is in the state
off. when it is Resting, it ignores intruder events.
•The :siren object always responds to fire events even when it is in the state
1) Who is responsible for designing a subsystem in design workflow
a ) System Analyst b) Architect c) Component engineer d) Use case engineer
2) Which statement is true about design subsystems?
a) They partially encapsulate behavior. b) They represent an independent capability
with clear interfaces. c) They model a single implementation variant.
d) They can only contain design classes.
3) Which task is performed during use-case realization refinement?
a) identify participating classes b) allocate responsibilities among classes
c) model messages between classes d) model associated class relationships
4) Which two statements are true about interfaces?
a) The interface should have a clear purpose.
b) A single interface should include as many possible methods, if not all methods, that
may be shared by objects that implement the interface.
c) An interface should be used to restrict which methods are exposed to a client.
d) Classes may have multiple interfaces depending on the purpose of each interface it
5) What does a required interface do?
a) exposes services to anonymous requestors
b) uses the services that a classifier requires to request from anonymous
c) declares the services that a classifier offers to provide anonymous
d) exposes methods that the requestor must use
6) Which two statements are true about use-case realization?
a) It lists the different steps performed by a use-case.
b) It provides traceability from Analysis and Design back to requirements.
c) It is created by the System Analyst.
d) It describes the use-case in terms of collaborating objects.
7) ____________ groups a set of provided and required interfaces
a) Sub system b) port c) class d) component
8) which diagrams shows the communication links between objects
a) sequence diagram b) collaboration diagram c) Timing diagram d) class
4) a, d
6) b, d
A Subsystem is a special type of component, it is a grouping
An interface is a collection of operations that are used to
specify a service of a class or a component
The set of interfaces realized by a classifier is known as its
When a classifier requires one or more interfaces for its
operation, these are known as its required interfaces.
A port graps a set of provided and required interfaces.
Component is a physical and replaceable part of a system that
conforms to and provides the realization of a set of interfaces
Subsystem interaction can show the interactions between
parts of the system
Timing diagram is a type of interaction diagram that focuses
on modeling timing constraints