Chapter 18. Software Reuse

Similar documents
Seminar report Software reuse

Dr. Tom Hicks. Computer Science Department Trinity University

SOFTWARE ENGINEERING. To discuss several different ways to implement software reuse. To describe the development of software product lines.

Software Engineering

Part 4. Development. -Software Reuse - Component-Based Software Engineering. JUNBEOM YOO Ver. 1.

Software Reuse and Component-Based Software Engineering

Study of Component Based Software Engineering

Minsoo Ryu. College of Information and Communications Hanyang University.

Chapter 7 Design and Implementation

Software Processes. Ian Sommerville 2006 Software Engineering, 8th edition. Chapter 4 Slide 1

Game Production: reuse

Component-based software engineering. Ian Sommerville 2004 Software Engineering, 7th edition. Chapter 19 Slide 1

Software Engineering Chap.7 - Design and Implementation

Design and Implementa3on

Software Reuse Techniques

Introduction to Software Reuse

Chapter 6 Architectural Design. Lecture 1. Chapter 6 Architectural design

Chapter 6 Architectural Design. Chapter 6 Architectural design

SOFTWARE ARCHITECTURE & DESIGN INTRODUCTION

Lecture 1. Chapter 6 Architectural design

Architectural Blueprint

Distributed systems. Distributed Systems Architectures. System types. Objectives. Distributed system characteristics.

CMSC 435: Software Engineering Section 0201

UML and Objectorientation. Kristian Sandahl

EPL603 Topics in Software Engineering

Component-Based Software Engineering TIP

Software Engineering - I An Introduction to Software Construction Techniques for Industrial Strength Software

Topics in Object-Oriented Design Patterns

ΗΜΥ 317 Τεχνολογία Υπολογισμού

Chapter 17 - Component-based software engineering. Chapter 17 So-ware reuse

Design Pattern What is a Design Pattern? Design Pattern Elements. Almas Ansari Page 1

Aspect-oriented Software Development. Ian Sommerville 2006 Software Engineering, 8th edition. Chapter 32 Slide 1

Verification and Validation. Ian Sommerville 2004 Software Engineering, 7th edition. Chapter 22 Slide 1

Aspect oriented Software Development. Ian Sommerville 2006 Software Engineering, 8th edition. Chapter 32 Slide 1

5/9/2014. Recall the design process. Lecture 1. Establishing the overall structureof a software system. Topics covered

Component-Based Software Engineering TIP

Chapter 6 Architectural Design

Distributed Systems Architectures. Ian Sommerville 2006 Software Engineering, 8th edition. Chapter 12 Slide 1

Data ownership within governance: getting it right

Architectural Design. Architectural Design. Software Architecture. Architectural Models

Distributed Systems Architectures. Ian Sommerville 2006 Software Engineering, 8th edition. Chapter 12 Slide 1

SYLLABUS CHAPTER - 1 [SOFTWARE REUSE SUCCESS FACTORS] Reuse Driven Software Engineering is a Business

UCSD Extension. Fundamentals of Web Services. Instructor: John Pantone. 2007, Objectech Corporation. All rights reserved

Appendix A - Glossary(of OO software term s)

Engr. M. Fahad Khan Lecturer Software Engineering Department University Of Engineering & Technology Taxila

How to Harvest Reusable Components in Existing Software. Nikolai Mansurov Chief Scientist & Architect

Variability Implementation Techniques for Platforms and Services (Interim)

CSCU9T4: Managing Information

An Introduction to Software Architecture By David Garlan & Mary Shaw 94

Design Patterns Design patterns advantages:

Slide 1. Design Patterns. Prof. Mirco Tribastone, Ph.D

OBJECT ORIENTED SYSTEM DEVELOPMENT Software Development Dynamic System Development Information system solution Steps in System Development Analysis

Review Software Engineering October, 7, Adrian Iftene

Software testing. Ian Sommerville 2006 Software Engineering, 8th edition. Chapter 23 Slide 1

Architectural Design

Component-based Architecture Buy, don t build Fred Broks

Verification and Validation. Assuring that a software system meets a user s needs. Verification vs Validation. The V & V Process

Software Design Patterns. Background 1. Background 2. Jonathan I. Maletic, Ph.D.

COSC 3351 Software Design. Design Patterns Behavioral Patterns (I)

CS 307: Software Engineering. Lecture 10: Software Design and Architecture

Patterns. Giovanni Sakti. in Software Engineering. Starqle

CHAPTER 9 DESIGN ENGINEERING. Overview

Enterprise Integration Patterns: Designing, Building, and Deploying Messaging Solutions

Architectural Blueprint The 4+1 View Model of Software Architecture. Philippe Kruchten

Describing the architecture: Creating and Using Architectural Description Languages (ADLs): What are the attributes and R-forms?

Second. Incremental development model

Chapter 32. Aspect-Oriented Software Development (AOSD) Ian Sommerville 2006 Software Engineering. Chapter 32 Slide 1

CSC207H: Software Design Lecture 6

1) Software Engineering

Incremental development A.Y. 2018/2019

Examples. Object Orientated Analysis and Design. Benjamin Kenwright

SOFTWARE ENGINEERING DECEMBER. Q2a. What are the key challenges being faced by software engineering?

Chapter 8, Object Design: Reusing Pattern Solutions

Reusable General Component in Unknown Domain

Establishing the overall structure of a software system

Compositional Model Based Software Development

Design Patterns. Observations. Electrical Engineering Patterns. Mechanical Engineering Patterns

Day 1 summary for day 2. Addison, TX

Software Prototyping Animating and demonstrating system requirements. Uses of System Prototypes. Prototyping Benefits

Reuse in Object Oriented Programming

Lesson 06. Requirement Engineering Processes

Lecture 15 Software Testing

CAS 703 Software Design

Enabling efficiency through Data Governance: a phased approach

Introduction to Software Engineering

Legacy Systems. Older software systems that remain vital to an organisation. Legacy systems. Legacy system replacement

Lecture 8: Use Case -Driven Design. Where UML fits in

PREPARE FOR TAKE OFF. Accelerate your organisation s journey to the Cloud.

Lecture 19: Introduction to Design Patterns

ASPECT GENERATOR. Audit Trail WEAVER. Aspect Editor. Weaving Strategies Editor. Model Editor. Mapping. Instructions. Original Model (XMI)

Specifying and Prototyping

VO Software Engineering

System models Abstract descriptions of systems whose requirements are being analysed. System modelling. Structured methods

Software specification and modelling. Requirements engineering

18.1 Definitions and General OO Principles

Requirements Engineering: Specification & Validation. Software Requirements and Design CITS 4401 Lecture 18

Software re-engineering

Requirements Engineering

High-Fidelity analysis of software systems

Architectural Documentation 1

Transcription:

Chapter 18 Software Reuse Ian Sommerville Lutz Prechelt Ian Sommerville 2004, Software Engineering, 7th edition, prechelt@inf.fu-berlin.de 1

Objectives To explain the benefits of software reuse and some reuse problems To discuss several different ways to implement software reuse To explain how reusable concepts can be represented as patterns or embedded in program generators To discuss COTS reuse To describe the development of software product lines Ian Sommerville 2004, Software Engineering, 7th edition, prechelt@inf.fu-berlin.de 2

Topics covered The reuse landscape Design patterns Generator based reuse Application frameworks Application system reuse Ian Sommerville 2004, Software Engineering, 7th edition, prechelt@inf.fu-berlin.de 3

Software reuse In most engineering disciplines, systems are designed by composing existing components that have been used in other systems. Software engineering has long been more focused on original development but it is now recognised that to reduce cost and to improve quality and time-to-market, we need to adopt a design process that is based on systematic reuse. Ian Sommerville 2004, Software Engineering, 7th edition, prechelt@inf.fu-berlin.de 4

Reuse-based software engineering Application system reuse The whole of an application system may be reused either by incorporating it without change into other systems or by developing application families. Component reuse Components of an application from sub-systems to single objects may be reused. Covered in Chapter 19. Object and function reuse Software components that implement a single welldefined object or function may be reused. Ian Sommerville 2004, Software Engineering, 7th edition, prechelt@inf.fu-berlin.de 5

Reuse benefits (1) Increased dependability Previously used SW tends to have fewer defects. Reduced process risk Building a component can fail more easily than reusing an existing one. Particularly true for large, complex components (subsystems). Sometimes not true, if the adaptability of the reusable component is unclear. Effective use of specialists Rare knowledge is encapsulated in a component and is then more readily and widely available. Ian Sommerville 2004, Software Engineering, 7th edition, prechelt@inf.fu-berlin.de 6

Reuse benefits (2) Standards compliance Reusing components can promote the adherence to standards (e.g. user interface look-and-feel). This improves usability of a component (for programmers and/or for end-users). Accelerated development Often more important than anything else. Ian Sommerville 2004, Software Engineering, 7th edition, prechelt@inf.fu-berlin.de 7

Reuse problems (1) Increased maintenance cost External changes to a reused (COTS) component may force changes to the reusing software. Required changes to a reused component may be more difficult to have than for a custom component. Lack of tool support There is little support for maintaining a catalog of reusable components and for finding components. Development tools do not support development with all kinds of reusable components well. Not-invented-here syndrome Many software engineers tend to prefer rewriting a component over reusing it. Ian Sommerville 2004, Software Engineering, 7th edition, prechelt@inf.fu-berlin.de 8

Reuse problems (2) The reuse barrier: 1. A software developer will only search for a reusable component if s/he expects to find an appropriate one. 2. S/he will only find it if it is described in a way s/he can recognize as providing a solution. 3. S/he will only use it if s/he can understand it. 4. Use will only be successful if the component can be adapted to the problem at hand. The whole process will start only if the developer expects all steps to be successful in the beginning. Reuse works well for many general-purpose components, but is difficult for highly domainspecific ones. Ian Sommerville 2004, Software Engineering, 7th edition, prechelt@inf.fu-berlin.de 9

The reuse landscape Although reuse is often simply thought of as the reuse of system components, there are many different approaches to reuse that may be used. Reuse is possible at a range of granularity levels from simple functions to complete application systems at a range of abstraction levels from requirements to code etc. at a range of scales from one-time-reuse to mass-marketing The reuse landscape covers the range of possible reuse techniques. Ian Sommerville 2004, Software Engineering, 7th edition, prechelt@inf.fu-berlin.de 10

The reuse landscape Design patterns Component frameworks Application product lines Aspect-oriented software development Component-based development Service-oriented systems Legacy system wrapping Program libraries COTS integration Configurable vertical applications Program generators Ian Sommerville 2004, Software Engineering, 7th edition, prechelt@inf.fu-berlin.de 11

Reuse approaches (1) Design patterns Componentbased development Application frameworks Legacy system wrapping Service-oriented systems Generic abstractions that occur across applications are represented as design patterns that show abstract and concrete objects and interactions. Systems are developed by integrating components (collections of objects) that conform to componentmodel standards. This is covered in Chapter 19. Collections of abstract and concrete classes that can be adapted and extended to create application systems. Legacy systems (see Chapter 2) that can be 'wrapped' by defining a set of interfaces and providing access to these legacy systems through these interfaces. Systems are developed by linking shared services that may be externally provided. Ian Sommerville 2004, Software Engineering, 7th edition, prechelt@inf.fu-berlin.de 12

Reuse approaches (2) Application product lines COTS integration Configurable vertical applications Program libraries Program generators Aspect-oriented software development An application type is generalised around a common architecture so that it can be adapted in different ways for different customers. Systems are developed by integrating existing application systems. A generic system is designed so that it can be configured to the needs of specific system customers. Class and function libraries implementing commonlyused abstractions are available for reuse. A generator system embeds knowledge of a particular types of application and can generate systems or system fragments in that domain. Shared components are woven into an application at different places when the program is compiled. Ian Sommerville 2004, Software Engineering, 7th edition, prechelt@inf.fu-berlin.de 13

Reuse planning factors The development schedule for the software. The expected software lifetime. The background, skills and experience of the development team. The criticality of the software and its nonfunctional requirements. The application domain. The execution platform for the software. Ian Sommerville 2004, Software Engineering, 7th edition, prechelt@inf.fu-berlin.de 14

Concept reuse When you reuse program or design components, you have to follow the design decisions made by the original developer of the component. This may limit the opportunities for reuse. However, a more abstract form of reuse is concept reuse: A particular approach is described in an implementationindependent way. At reuse time, an implementation is then developed. The two main approaches to concept reuse are: Design patterns; Generative programming. Ian Sommerville 2004, Software Engineering, 7th edition, prechelt@inf.fu-berlin.de 15

Design patterns A design pattern is a way of reusing abstract knowledge about a problem and its solution. A pattern is a description of the problem and the essence of its solution. It should be sufficiently abstract to be reused in different settings. Many patterns aim at flexibility and rely on object characteristics such as inheritance and polymorphism. Ian Sommerville 2004, Software Engineering, 7th edition, prechelt@inf.fu-berlin.de 16

Pattern elements Name A meaningful pattern identifier. Problem description Context, requirements, constraints Solution description Not a concrete design but a template for a design solution that can be instantiated in different ways. Consequences The results, variants and trade-offs when applying the pattern. Ian Sommerville 2004, Software Engineering, 7th edition, prechelt@inf.fu-berlin.de 17

Multiple displays C D B A 50 25 0 A B C D Observer 1 Subject A: 40 B: 25 C: 15 D: 20 Observer 2 Ian Sommerville 2004, Software Engineering, 7th edition, prechelt@inf.fu-berlin.de 18

The Observer pattern Name Observer. Description Separates the display of object state from the object itself. Problem description Used when multiple displays of state are needed and must be added and removed at run-time. Solution description See slide with UML description. Consequences Optimisations to enhance display performance must be designed for all observers in advance. Ian Sommerville 2004, Software Engineering, 7th edition, prechelt@inf.fu-berlin.de 19

The Observer pattern Subject Observer Attach (Observer) Detach (Observer) Notify () for all o in observers o -> Update () Update () ConcreteSubject ConcreteObserver GetState () return subjectstate Update () observerstate = subject -> GetState () subjectstate observerstate Ian Sommerville 2004, Software Engineering, 7th edition, prechelt@inf.fu-berlin.de 20

Generator-based reuse Program generators involve the reuse of standard patterns and algorithms. These are embedded in the generator and parameterised by user commands. Generator-based reuse is possible when domain abstractions and their mapping to executable code can be identified. A domain-specific language is used to compose and control these abstractions. Ian Sommerville 2004, Software Engineering, 7th edition, prechelt@inf.fu-berlin.de 21

Types of program generator Types of program generator Application generators for business data processing; Parser and lexical analyser generators for language processing (e.g. compilers); Code generators in CASE tools. Generator-based reuse is very cost-effective but its applicability is limited to some application domains. It is easier for end-users to develop programs using generators compared to other componentbased approaches to reuse. Ian Sommerville 2004, Software Engineering, 7th edition, prechelt@inf.fu-berlin.de 22

Aspect-oriented development Aspect-oriented development (AOD) addresses a major software engineering problem: the separation of concerns. Concerns are often not simply associated with application functionality but are cross-cutting. E.g. all components may monitor their own operation, all components may have to maintain security, etc. In AOD, cross-cutting concerns are implemented separately (as 'aspects') and are dynamically woven into a program. The concern code is reused and the new system is generated by the aspect weaver. Requires extensions to existing programming languages. Ian Sommerville 2004, Software Engineering, 7th edition, prechelt@inf.fu-berlin.de 23

Aspect-oriented development Aspect 1 Aspect 2 Input source code <statements 1> join point 1 <statements 2> join point 2 <statements 3> Aspect Weaver Generated code <statements 1> Aspect 1 <statements 2> Aspect 2 <statements 3> Any join point may be filled by more than one aspect Ian Sommerville 2004, Software Engineering, 7th edition, prechelt@inf.fu-berlin.de 24

Application frameworks A framework is a conceptually complete design plus an incomplete implementation. Typically object-oriented: a collection of abstract and concrete classes and the interfaces between them. Describes a sub-system or complete system. Implementation is completed by adding components to fill in the missing parts. Miniature example: java.util.collections.collection: static void sort(list list) Requires that all elements of the list implement interface Comparable: int compareto(object o) Reusable 'sort' will call user-defined function 'compareto'. Ian Sommerville 2004, Software Engineering, 7th edition, prechelt@inf.fu-berlin.de 25

Types of framework System infrastructure frameworks Support the development of system infrastructures such as communications, user interfaces and compilers. Middleware integration frameworks Standards and classes that support resource management and component communication. Enterprise application frameworks Support the development of specific types of application such as telecommunications or financial systems. A problem with frameworks is their complexity. It takes long to learn using them effectively. Ian Sommerville 2004, Software Engineering, 7th edition, prechelt@inf.fu-berlin.de 26

Model-View-Controller (MVC) System infrastructure framework for GUI design. Allows for multiple presentations of an object and separate interactions with each. Using an MVC framework involves the instantiation of a number of design patterns. E.g. Observer pattern, Strategy pattern, maybe Composite pattern. Parts of the implementations of these patterns have to be provided by the framework user. Ian Sommerville 2004, Software Engineering, 7th edition, prechelt@inf.fu-berlin.de 27

Model-View-Controller User inputs Controller state view modification messages View state Controller methods View methods Model edits Model state Model queries and updates Model methods Ian Sommerville 2004, Software Engineering, 7th edition, prechelt@inf.fu-berlin.de 28

Application system reuse Involves the reuse of entire application systems either by configuring a system for an environment or by integrating two or more systems to create a new application. Two approaches covered here: COTS product integration; Product line development. Ian Sommerville 2004, Software Engineering, 7th edition, prechelt@inf.fu-berlin.de 29

COTS product reuse COTS = Commercial Off-The-Shelf software. COTS systems are usually complete application systems that offer an API (Application Programming Interface). Building large systems by integrating COTS systems is now a viable development strategy for some types of system such as E-commerce systems. The key benefit is faster application development and, usually, lower development costs. Ian Sommerville 2004, Software Engineering, 7th edition, prechelt@inf.fu-berlin.de 30

COTS design choices Which COTS products offer the most appropriate functionality? There may be several similar products that may be used. Can I later switch my system over to a different COTS product if I have to? If the COTS is decomissioned or does not support future requirements. How will data be exchanged? Individual products use their own data structures and formats. What features of the product will actually be used? Most products have more functionality than is needed. You should try to deny access to unused functionality. Ian Sommerville 2004, Software Engineering, 7th edition, prechelt@inf.fu-berlin.de 31

E-procurement system Client Web browser E-mail system Server E-commerce system Adaptor Ordering and invoicing system E-mail system Adaptor Ian Sommerville 2004, Software Engineering, 7th edition, prechelt@inf.fu-berlin.de 32

COTS products reused On the client, standard e-mail and web browsing programs are used. On the server, an e-commerce platform has to be integrated with an existing ordering system. This involves writing an adaptor so that they can exchange data. An e-mail system is also integrated to generate e- mail for clients. This also requires an adaptor to receive data from the ordering and invoicing system. Ian Sommerville 2004, Software Engineering, 7th edition, prechelt@inf.fu-berlin.de 33

COTS system integration problems Lack of control over functionality and performance COTS systems may be less effective than they appear. Problems with COTS system inter-operability Different COTS systems may make conflicting assumptions so that integration can be difficult. No control over system evolution COTS vendors, not system users control evolution. Finite support from COTS vendors COTS vendors may not offer support over the lifetime of the product. Ian Sommerville 2004, Software Engineering, 7th edition, prechelt@inf.fu-berlin.de 34

Software product lines Software product lines or application families are applications with generic functionality that can be adapted and configured for use in a specific context. Adaptation may involve: Component and system configuration; Adding new components to the system; Selecting from a library of existing components; Modifying components to meet new requirements. Ian Sommerville 2004, Software Engineering, 7th edition, prechelt@inf.fu-berlin.de 35

COTS product specialisation Platform specialisation Different versions of the application are developed for different platforms. Environment specialisation Different versions of the application are created to handle different operating environments e.g. different types of communication equipment. Functional specialisation Different versions of the application are created for customers with different requirements. Or for different marketing needs (e.g. "light" versions). Process specialisation Different versions of the application are created to support different business processes. Ian Sommerville 2004, Software Engineering, 7th edition, prechelt@inf.fu-berlin.de 36

COTS configuration Deployment-time configuration A generic system is configured by embedding knowledge of the customer s requirements and business processes. The software itself is not changed. Design-time configuration A common generic code is adapted and changed according to the requirements of particular customers. Creates a specific version of the software. Ian Sommerville 2004, Software Engineering, 7th edition, prechelt@inf.fu-berlin.de 37

Deployment-time configuration: ERP systems An Enterprise Resource Planning (ERP) system is a generic system that supports common business processes such as ordering and invoicing, production planning, etc. These are very widely used in large companies and represent probably the most common form of hugescale software reuse. The generic core is adapted at deployment time by including modules and by incorporating knowledge of specific business processes and rules. Ian Sommerville 2004, Software Engineering, 7th edition, prechelt@inf.fu-berlin.de 38

ERP system organisation Configuration planning tool Configuration database Generic ERP system System database Ian Sommerville 2004, Software Engineering, 7th edition, prechelt@inf.fu-berlin.de 39

Design time configuration: Product lines Software product lines that are configured at design time are instantiations of generic application architectures as discussed in Chapter 13. Generic products usually emerge after experience with specific products. Architectures must be structured in such a way to separate different sub-systems and to allow them to be modified e.g. by separating entities strongly in the architecture: The higher levels in the system access entities through descriptions rather than directly. Ian Sommerville 2004, Software Engineering, 7th edition, prechelt@inf.fu-berlin.de 40

Generic resource management system User inter face User authentication Resource delivery Query management Resource management Resource policy control Resource allocation Transaction management Resource database Ian Sommerville 2004, Software Engineering, 7th edition, prechelt@inf.fu-berlin.de 41

Vehicle despatching A specialised resource management system where the aim is to allocate resources (vehicles) to handle incidents. Adaptations include: At the UI level, there are components for operator display and communications; At the I/O management level, there are components that handle authentication, reporting and route planning; At the resource management level, there are components for vehicle location and despatch, managing vehicle status and incident logging; The database includes equipment, vehicle and map databases. Ian Sommerville 2004, Software Engineering, 7th edition, prechelt@inf.fu-berlin.de 42

A vehicle despatching system User interface Comms system inter face Operator authentication Map and route planner Report generator Query manager Vehicle status manager Incident logger Vehicle despatcher Equipment manager Vehicle locator Equipment database Transaction management Vehicle database Incident log Map database Ian Sommerville 2004, Software Engineering, 7th edition, prechelt@inf.fu-berlin.de 43

Product instance development Renegotiate requirements Elicit stakeholder requirements Choose closest-fit family member Adapt existing system Deliver new family member Ian Sommerville 2004, Software Engineering, 7th edition, prechelt@inf.fu-berlin.de 44

Product instance development Elicit stakeholder requirements Use existing family member as a prototype. Choose closest-fit family member Find the family member that best meets the requirements. Re-negotiate requirements Adapt requirements as necessary to capabilities of the software. Adapt existing system Develop new modules and make changes for family member. Deliver new family member Document key features for further member development. Ian Sommerville 2004, Software Engineering, 7th edition, prechelt@inf.fu-berlin.de 45

Key points Advantages of reuse are lower costs, faster software development and lower risks. Successful reuse requires overcoming a number of barriers: Creation/availability, discovery, understanding, fitness, trust, adaptation, evolution. Design patterns are high-level abstractions that describe and discuss problem/solution pairs. Reusable concepts may be embedded in a program generator system. Application frameworks are collections of concrete and abstract objects that are designed for reuse through specialisation. Ian Sommerville 2004, Software Engineering, 7th edition, prechelt@inf.fu-berlin.de 46

Key points (2) COTS product reuse is concerned with the reuse of large, off-the-shelf systems. Problems with COTS reuse include lack of control over functionality, performance, and evolution and problems with inter-operation. ERP systems are created by configuring a generic system with information about a customer s business. Software product lines are related applications developed around a common core of shared functionality. Ian Sommerville 2004, Software Engineering, 7th edition, prechelt@inf.fu-berlin.de 47