Chapter 19: Interfaces and Components [Arlow and Neustadt, 2005] University of Nevada, Reno Department of Computer Science & Engineering.

Slides:



Advertisements
Similar presentations
Solutions to Review Questions. 4.1 Define object, class and instance. The UML Glossary gives these definitions: Object: an instance of a class. Class:
Advertisements

COMPONENT DIAGRAM in UML 2.0 Veronica Carrega
Activity Diagrams [Arlow and Neustadt, 2005] CS 425 / 625 Seminar on Software Engineering University of Nevada, Reno Department of Computer Science & Engineering.
Chapter 7: Classes and Objects Chapter 8: Finding Analysis Classes [Arlow and Neustadt, 2005] CS 426/CPE 426 Senior Projects University of Nevada, Reno.
Page 1 Building Reliable Component-based Systems Chapter 7 - Role-Based Component Engineering Chapter 7 Role-Based Component Engineering.
C OMPONENT & D EPLOYMENT D IAGRAMS Hoang Huu Hanh, Hue University hanh-at-hueuni.edu.vn.
1 © Wolfgang Pelz UML3 UML 3 Notations describe how to use reusable software. Package Component Deployment Node.
1 CS 426 Senior Projects Chapter 9: Relationships Chapter 10: Inheritance and Polymorphism [Arlow and Neustadt, 2005] February 12, 2009.
1 CS 426 Senior Projects Chapter 19: Interfaces and Components [Arlow & Neustadt 2005] February 28, 2008.
THE OBJECT-ORIENTED DESIGN WORKFLOW Interfaces & Subsystems.
CS 425/625 Software Engineering System Models
1 CS 426 Senior Projects Chapter 7: Classes and Objects & Chapter 8: Finding Analysis Classes [Arlow and Neustadt, 2002] February 14, 2006.
Chapter 5: Advanced Use Case Modeling [Arlow and Neustadt, 2005] CS 426/CPE 426 Senior Projects University of Nevada, Reno Department of Computer Science.
1 CS 426 Senior Projects Chapter 9: Relationships Chapter 10: Inheritance and Polymorphism [Arlow and Neustadt, 2002] February 27, 2007.
Component and Deployment Diagrams
1/31 CS 426 Senior Projects Chapter 1: What is UML? Chapter 2: What is UP? [Arlow and Neustadt, 2005] January 22, 2009.
© Copyright Eliyahu Brutman Programming Techniques Course.
1 CS 691z / 791z Topics on Software Engineering Chapter 17: Interfaces and Subsystems [Arlow & Neustadt, 2002] March 6, 2007.
Introduction to Software Design Chapter 1. Chapter 1: Introduction to Software Design2 Chapter Objectives To become familiar with the software challenge.
Objectives Design Class Diagrams Issues in system design Generalization Review UML papers.
What is UML? What is UP? [Arlow and Neustadt, 2005] January 23, 2014
Chapter 13 Starting Design: Logical Architecture and UML Package Diagrams.
Chapter 7: Classes and Objects Chapter 8: Finding Analysis Classes [Arlow and Neustadt, 2005] CS 426 Senior Projects in Computer Science University of.
Copyright 2002 Prentice-Hall, Inc. Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich Chapter 20 Object-Oriented.
Unified Modeling Language, Version 2.0
Object Oriented Analysis & Design & UML (Unified Modeling Language)1 Part V: Design The Design Workflow Design Classes Refining Analysis Relationships.
Systems Analysis and Design in a Changing World, 3rd Edition
GRASP: Designing Objects with Responsibilities
Modeling Component-based Software Systems with UML 2.0 George T. Edwards Jaiganesh Balasubramanian Arvind S. Krishna Vanderbilt University Nashville, TN.
Chapter 16 Applying UML and Patterns Craig Larman
1 Advanced Software Architecture Muhammad Bilal Bashir PhD Scholar (Computer Science) Mohammad Ali Jinnah University.
CBSE 2014 Modeling Components with UML. Bibliography Modelling components in UML – Main text: Kim Hamilton, Russell Miles, Learning UML 2.0, OReilly,
Chapter 4: Use Case Modeling [Arlow and Neustadt, 2005] CS 790M Project preparation (II) University of Nevada, Reno Department of Computer Science & Engineering.
Logical view –show classes and objects Process view –models the executables Implementation view –Files, configuration and versions Deployment view –Physical.
Part VII: Design Continuous
Karolina Muszyńska Based on: S. Wrycza, B. Marcinkowski, K. Wyrzykowski „Język UML 2.0 w modelowaniu SI”
UML / UML 2.0 Diagrams (Part I) 1. Overview of the 13 diagrams of UML Structure diagrams 1.Class diagram 2.Composite structure diagram (*) 3.Component.
Slide 1 Systems Analysis and Design With UML 2.0 An Object-Oriented Approach, Second Edition Chapter 2: Introduction to Object-Oriented Systems Analysis.
COMPONENT DIAGRAM in UML 2.0 Veronica Carrega. PLAN OF TALK  Introduction about components  Components and component diagrams in uml 2.0  Case study.
1 Unified Modeling Language, Version 2.0 Chapter 2.
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 32. Review Behavioral Patterns – Observer Pattern – Chain of command.
Chapter 14: Activity Diagrams November 2015 [Arlow and Neustadt, 2005] CS 425/625 Senior Projects University of Nevada, Reno Department of Computer Science.
Analysis Yaodong Bi. Introduction to Analysis Purposes of Analysis – Resolve issues related to interference, concurrency, and conflicts among use cases.
Chapter 6: The Analysis Workflow Chapter 7: Classes and Objects Chapter 8: Finding Analysis Classes [Arlow and Neustadt, 2005] CS 426 Senior Projects in.
Basic Characteristics of Object-Oriented Systems
Chapter 9: Relationships Chapter 10: Inheritance and Polymorphism [Arlow and Neustadt, 2005] CS 426 Senior Projects in Computer Science University of Nevada,
Design Concepts ch-8
Chapter 16: The Design Workflow Chapter 17: Design Classes
CompSci 280 S Introduction to Software Development
COMPONENT & DEPLOYMENT DIAGRAMS
What is UML? What is UP? [Arlow and Neustadt, 2005] October 5, 2017
Systems Analysis and Design With UML 2
Software Design AITI GP John Paul Vergara.
Chapter 13 Logical Architecture.
Chapter 19: Interfaces and Components
CS 426 Senior Projects Chapter 9: Relationships
Chapter 18: Refining Analysis Relationships
CBSE 2014 Modeling Components with UML
Chapter 7: Classes and Objects Chapter 8: Finding Analysis Classes
Chapter 5: Advanced Use Case Modeling
Chapter 20 Object-Oriented Analysis and Design
Chapter 7: Classes and Objects Chapter 8: Finding Analysis Classes
Starting Design: Logical Architecture and UML Package Diagrams
Introduction to Computer Science for Majors II
Chapter 13 Logical Architecture.
Chapter 19: Interfaces and Components
Chapter 19: Interfaces and Components
Design Yaodong Bi.
Interfaces and Components
Chapter 19: Interfaces and Components
Presentation transcript:

Chapter 19: Interfaces and Components [Arlow and Neustadt, 2005] University of Nevada, Reno Department of Computer Science & Engineering

 Interfaces and subsystems:  Introduction  Interfaces  Interface realization vs. inheritance  Components  Subsystems  Finding interfaces  The layering pattern  Advantages and disadvantages of interfaces 2 Interfaces and Components

3  Chapter 19 roadmap, Fig [Arlow & Neustadt, 2005]

4  Designing large software applications is concerned with breaking a system up into subsystems (as independent as possible)  Interactions between subsystems are mediated by interfaces Fig [Arlow & Neustadt, 2005]

 An interface specifies a named set of public features  It defines a contract to be implemented by a classifier  In other words, an interface defines a service offered by a class, component, or system  It also separates specification from implementation  An interface cannot be instantiated  Anything that realizes an interface (e.g., a class) must accept and agree by the contract defined by the interface 5 Interfaces and Components

 Interface features that need to be realized, Table 19.1 [Arlow & Neustadt 2005] 6 Interfaces and Components

 Interfaces allow “design to a contract” as compared to “design to an implementation” supported by classes  This provides a high degree of flexibility  Modern software architectures are based on the concept of “service”, supported by interfaces  The attributes and operations of an interface should be fully specified, with:  Complete operation signature  The semantics of the operation (text or pseudocode)  Name and type of the attributes  Any operation or attribute stereotypes, constraints, tagged values 7 Interfaces and Components

 The set of interfaces realized by a classifier is known as provided interfaces, with UML syntax (two styles) shown in Fig [Arlow & Neustadt 2005]  Note that the two different notations for the realization relationship 8 Interfaces and Components

 The set of interfaces needed by a classifier for its operations are called required interfaces, as shown in Fig [Arlow & Neustadt 2005]  Note that the two different notations for the dependency relationship, with the socket symbol in the right-hand side 9 Interfaces and Components

 Fig [Arlow & Neustadt 2005] shows an example of an assembled system 10 Interfaces and Components

Interfaces in Java: the collection classes, Fig [Arlow & Neustadt 2005] 11 Interfaces and Components

 Interface: “realizes contract specified by”  Inheritance: “is a”  Both can generate polymorphism  Fig [Arlow & Neustadt 2005] shows an inheritance- based solution 12 Interfaces and Components

 Adding non-borrowable items such as journal needs further modeling Fig [Arlow & Neustadt 2005] 13 Interfaces and Components

 A more elegant solution is shown in Fig [Arlow & Neustadt 2005] 14 Interfaces and Components

 Still better is to combine inheritance and interfaces, Fig [Arlow & Neustadt 2005]. Advantages: every item in the Library is a LibraryItem; borrowability concept factored out; fewer classes; simpler inheritance hierrachy; fewer compositions and inheritances 15 Interfaces and Components

 Interfaces are key elements for component-based development (CBD)  They allow addition of plug-in parts (with varied implementations) without changing the specification  Both with components and subsystems, interfaces support low coupling and provide high architectural flexibility 16 Interfaces and Components

 A component is a “modular part of the system that encapsulates its contents and whose manifestation is replaceable within its environment”  It acts as a black box whose external behaviour is completely defined by its interfaces (provided and required); hence, it can be replaced by any other component that supports the same protocol  Fig [Arlow & Neustadt 2005] shows the UML notation 17 Interfaces and Components

 Components may depend on other components  To decouple components, always mediate the dependency with interfaces, Fig [Arlow & Neustadt 2005] 18 Interfaces and Components

19 Component stereotypes, Table 19.2 [Arlow & Neustadt 2005]

 A subsystem is a component that acts as unit of decomposition for a larger system  Interfaces connect subsystems to create a system architecture  Subsystems are used to:  Separate design concerns  Represent large-grained components  Wrap legacy systems  A system example is shown in Fig [Arlow & Neustadt 2005] 20 Interfaces and Components

 Techniques for finding interfaces in a system or subsystem:  Challenge each association  Challenge each message sent  Factor out groups of operations reusable elsewhere  Factor out sets of operations that repeat in classes  Factor out sets of attributes that repeat in classes  Look at classes that have similar roles in the system  Consider future extensions 21 Interfaces and Components

22

23

 Designing with interfaces increases flexibility and extensibility  Also, using interfaces supports low coupling by reducing the number of dependencies between classes, subsystems and components  With interfaces, a model can be neatly separated in cohesive subsystems  Drawbacks of interfaces relate to added complexity and increased performance costs  As a guideline, use interfaces for the more “fluid” parts of the system and dispense of them for the more stable parts of the system 24 Interfaces and Components