Docsity

Software Engineering: Interfaces, Components, Concepts, Advantages, and Implementation, Slides of Software Engineering

Partial preview of the text

Download Software Engineering: Interfaces, Components, Concepts, Advantages, and Implementation and more Slides Software Engineering in PDF only on Docsity!

 Interfaces and subsystems:

 Introduction

 Interfaces

 Interface realization vs. inheritance

 Components

 Subsystems

 Finding interfaces

 The layering pattern

 Advantages and disadvantages of interfaces

 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. 19.2 [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

 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

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

 Fig. 19.5 [Arlow & Neustadt 2005] shows an example of an assembled system

Interfaces in Java: the collection classes, Fig. 19. [Arlow & Neustadt 2005]

 Adding non-borrowable items such as journal needs further modeling Fig. 19.8 [Arlow & Neustadt 2005]

 A more elegant solution is shown in Fig. 19.9 [Arlow & Neustadt 2005]

 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

 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. 19.15 [Arlow & Neustadt 2005] shows the UML notation

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. 19.19 [Arlow & Neustadt 2005]