Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
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 I...
Learning Objectives
At the end of this unit the student will be in a position to:
• Model applications using Interfaces an...
Design a Subsystem
A Subsystem is a special type of component, it is a grouping of elements.
The Component Engineer in the...
• The activity design a subsystem is about decomposing the system into a collection
of subsystems.
• Interaction between S...
The attributes and operations in an interface should include
• The complete operation signature (name, type of all paramet...
Interface realization vs. Inheritance
Interface realization: “realizes a contract specified by”
Inheritance: “is a” relati...
Library
Book CD
Borrow
Assembly
connector
1 1
0..* 0..*
{
Library
Library Item
BorrowableItem NonBorrowable Item
Journal
B...
Ports
A port graps a set of provided and required interfaces.
It indicates a specific point of interaction between a class...
Interfaces and component based development
Interfaces are the key to component-based development. This is about
constructi...
Types of Components
Three kinds of Components
 Deployment Component: These are the components necessary and sufficient
to...
Component Stereotypes
Stereotype Semantics
<<build Component>> A Component that defines a set of things
for organizational...
Sub Systems
• A system decomposed into a collection of Sub Systems
• Subsystem is a set of elements organized to accomplis...
Finding interfaces
Interfaces can be found in a system by
• Challenge each association
• Challenge each message send
• Fac...
Design a Use Case
Is about finding the design classes, interfaces and components.
<<Subsystem>>
Use case model
Requirement...
Inputs to Design a Use case
• Use case model
• Requirements model
• Analysis model
• Design model
• Deployment model
Outpu...
Use case realization-design consist of
 Class diagrams: that depict its participating analysis classes
 Interaction diag...
Sequence diagram : show the objects participating in the interaction by their
“lifelines” and the messages that they send ...
Communication/collaboration diagram: Shows the relationships among the
objects.
Example: Communication diagram of Add Cour...
Subsystem interaction
can show the interactions between parts of the system
<<Subsystem>>
Customer
Customer Manager
<<Susb...
Timing diagrams
• This is a type of interaction diagram that focuses on modeling timing
constraints
• The timing diagram i...
QUIZ
1) Who is responsible for designing a subsystem in design workflow
a ) System Analyst b) Architect c) Component engin...
5) What does a required interface do?
a) exposes services to anonymous requestors
b) uses the services that a classifier r...
KEY
1) c
2) b
3) d
4) a, d
5) b
6) b, d
7) b
8) b
Summary:
 A Subsystem is a special type of component, it is a grouping
of elements
 An interface is a collection of oper...
THANK YOU
Upcoming SlideShare
Loading in …5
×

Ooad content of unit vi

56 views

Published on

Ooad content of unit vi

Published in: Engineering
  • Be the first to comment

  • Be the first to like this

Ooad content of unit vi

  1. 1. Subject: Object Oriented Analysis and Design B.Tech III Year II-Semester Computer Science &Engineering
  2. 2. 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
  3. 3. Learning Objectives 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 component diagrams • Understand the Properties of a well-structured component diagram .
  4. 4. 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. <<Subsystem>> <<Subsystem>> Architecture description Subsystem (Outlined) Interface (Outlined) Subsystem (complete) Interface (complete) Component Engineer Design a subsystem
  5. 5. • The activity design a subsystem is about decomposing the system into a collection of subsystems. • 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 Examples: <<interface>> IWindow Open() Close() Move() <<interface>> URLStreamHandler <<interface>> ITransaction OpenConnection() Parse URL() SetURL() toExternalForm() Start() performAction() Commit() rollback()
  6. 6. The attributes and operations in an interface should include • The complete operation signature (name, type of all parameters, and return type) • 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. Example: Speaker <<Interface>> Speak() German Speaker Speak() Spanish Speaker Speak() English Speaker Speak()
  7. 7. 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. Example: <<Interface>> Borrow Borrow() Return() isOverdue() Book CD “Class” style notation Book CD BorrowInterface realization relationship “Lollipop” style notation
  8. 8. Library Book CD Borrow Assembly connector 1 1 0..* 0..* { Library Library Item BorrowableItem NonBorrowable Item Journal Book CD 1 0..* 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.
  9. 9. Ports 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 Interfaces Examples: Provided interface Book Port Presentation Display medium Display Viewer view Book Presentation:Display A aProtectedPort Required interface Library services Searchport SearchBooks Search Video Inventory A viewer class that connects to the presentation port of the Book class Ports may have a visibility Public visibility Protected visibility
  10. 10. Interfaces and component based development Interfaces are the key to component-based development. This is about constructing software from plug –in parts. Component:  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 Example: fraudagent fraudAgent fraudPolicy patternSearch
  11. 11. 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 executables (EXEs).  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. Users.cpp Libsys.exe db.dl Libstaff.cpp ------------ - Example
  12. 12. Component Stereotypes Stereotype Semantics <<build Component>> A Component that defines a set of things for organizational or System-level development purposes <<process>> A transaction-based Component <<service>> Functional Component that Computes a value <<SubSystem>> A unit of hierarchical decomposition for large Systems
  13. 13. Sub Systems • 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. <<System>> Retail Enterprise System <<Subsystem>> Warehouse management subsystem <<Subsystem>> In-store management subsystem <<Subsystem>> Customer service subsystem Systems and subsystems
  14. 14. Finding interfaces 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.
  15. 15. Design a Use Case Is about finding the design classes, interfaces and components. <<Subsystem>> Use case model Requirements model Analysis model Design model Deployment model Use case realization-design Design class (Outlined) Subsystem (outlined) Interface (outlined) Use case Engineer Design a use case
  16. 16. 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 requirements o Is an organization model element used to group a number of artifacts related to the design of a Use case
  17. 17. 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 use case 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
  18. 18. 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
  19. 19. Communication/collaboration diagram: Shows the relationships among the objects. Example: Communication diagram of Add Course use case in URS
  20. 20. Subsystem interaction can show the interactions between parts of the system <<Subsystem>> Customer Customer Manager <<Susbsystem>> Customer :Customer manager | | | | | | | | | | | | | | ----------------------------------------------- CustomerDetails getCustomerDetails(cid) :Sales Agent
  21. 21. Timing diagrams • This is a type of interaction diagram that focuses on modeling timing constraints • 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 Example: Sounding Intruder alarm Resting Off Sounding Intruder alarm Off Sounding Fire alarm State or condition . . . . .: S I R E N •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 Resting.
  22. 22. QUIZ 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 implements.
  23. 23. 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 providers c) declares the services that a classifier offers to provide anonymous requestors 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 diagram
  24. 24. KEY 1) c 2) b 3) d 4) a, d 5) b 6) b, d 7) b 8) b
  25. 25. Summary:  A Subsystem is a special type of component, it is a grouping of elements  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 provided interfaces  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
  26. 26. THANK YOU

×