Presentation is loading. Please wait.

Presentation is loading. Please wait.

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14Slide 1 Design with Reuse l Building software from reusable components.

Similar presentations


Presentation on theme: "©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14Slide 1 Design with Reuse l Building software from reusable components."— Presentation transcript:

1 ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14Slide 1 Design with Reuse l Building software from reusable components.

2 ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14Slide 2 Objectives l To explain the benefits of software reuse and some reuse problems l To describe different types of reusable component and processes for reuse l To introduce application families as a route to reuse l To describe design patterns as high-level abstractions that promote reuse

3 ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14Slide 3 Topics covered l 14.1 Component-based development l 14.2 Application families l 14.3 Design patterns

4 ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14Slide 4 Software reuse l In most engineering disciplines, systems are designed by composing existing components that have been used in other systems l Software engineering has been more focused on original development but it is now recognised that to achieve better software, more quickly and at lower cost, we need to adopt a design process that is based on systematic reuse

5 ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14Slide 5 Reuse-based software engineering l Application system reuse l Component reuse l Function reuse

6 ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14Slide 6 Reuse practice l Application system reuse Widely practised as software systems are implemented as application families. COTS reuse is becoming increasingly common l Component reuse Now seen as the key to effective and widespread reuse through component-based software engineering. However, it is still relatively immature l Function reuse Common in some application domains (e.g. engineering) where domain-specific libraries of reusable functions have been established

7 ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14Slide 7 Benefits of reuse l Increased reliability l Reduced process risk l Effective use of specialists l Standards compliance l Accelerated development

8 ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14Slide 8 Requirements for design with reuse l It must be possible to find appropriate reusable components l The re-user of the component must be confident that the components will be reliable and will behave as specified l The components must be documented so that they can be understood and, where appropriate, modified

9 ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14Slide 9 Reuse problems l Increased maintenance costs l Lack of tool support l Not-invented-here syndrome l Maintaining a component library l Finding and adapting reusable components

10 ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14Slide 10 Generator-based reuse l Program generators involve the reuse of standard patterns and algorithms l These are embedded in the generator and parameterised by user commands. A program is then automatically generated l Generator-based reuse is possible when domain abstractions and their mapping to executable code can be identified l A domain specific language is used to compose and control these abstractions

11 ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14Slide 11 Types of program generator l Types of program generator Application generators for business data processing Parser and lexical analyser generators for language processing Code generators in CASE tools l Generator-based reuse is very cost-effective but its applicability is limited to a relatively small number of application domains l It is easier for end-users to develop programs using generators compared to other component- based approaches to reuse

12 ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14Slide 12 Reuse through program generation

13 ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14Slide 13 14.1 Component-based development l Component-based software engineering (CBSE) is an approach to software development that relies on reuse l Components are more abstract than object classes and can be considered to be stand-alone service providers

14 ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14Slide 14 Components l Components provide a service without regard to where the component is executing or its programming language l Components can range in size from simple functions to entire application systems l Components are independent – very loosely coupled l Components are encapsulated

15 ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14Slide 15 Component interfaces

16 ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14Slide 16 Component interfaces l Provides interface Defines the services that are provided by the component to other components l Requires interface Defines the services that specifies what services must be made available for the component to execute as specified

17 ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14Slide 17 Example: Printing services component

18 ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14Slide 18 Components – different levels of abstractions l Functional abstraction l Casual groupings l Data abstractions l Cluster abstractions l System abstraction

19 ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14Slide 19 CBSE processes l Component-based development can be integrated into a standard software process by incorporating a reuse activity in the process l However, in reuse-driven development, the system requirements are modified to reflect the components that are available l CBSE usually involves a prototyping or an incremental development process with components being ‘glued together’ using a scripting language

20 ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14Slide 20 An opportunistic reuse process

21 ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14Slide 21 Development with reuse

22 ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14Slide 22 CBSE problems l Component incompatibilities may mean that cost and schedule savings are less then expected l Finding and understanding components l Managing evolution as requirements change in situations where it may be impossible to change the system components

23 ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14Slide 23 14.1.1 Application frameworks l Frameworks are a sub-system design made up of a collection of abstract and concrete classes and the interfaces between them l The sub-system is implemented by adding components to fill in parts of the design and by instantiating the abstract classes in the framework l Frameworks are moderately large entities that can be reused

24 ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14Slide 24 Framework classes l System infrastructure frameworks l Middleware integration frameworks l Enterprise application frameworks

25 ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14Slide 25 Extending frameworks l Frameworks are generic and are extended to create a more specific application or sub- system l Extending the framework involves Adding concrete classes that inherit operations from abstract classes in the framework Adding methods that are called in response to events that are recognised by the framework (call backs) l Problem with frameworks is their complexity and the time it takes to use them effectively

26 ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14Slide 26 Model-view controller l System infrastructure framework for GUI design l Allows for multiple presentations of an object and separate interactions with these presentations l MVC framework involves the instantiation of a number of patterns (discussed later)

27 ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14Slide 27 Model-view controller

28 ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14Slide 28 14.1.2 COTS product reuse l COTS - Commercial Off-The-Shelf systems l COTS systems are usually complete application systems that offer an API (Application Programming Interface) l Building large systems by integrating COTS systems is now a viable development strategy for some types of system such as E-commerce systems

29 ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14Slide 29 COTS system integration problems l Lack of control over functionality and performance l Problems with COTS system inter-operability l No control over system evolution l Support from COTS vendors

30 ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14Slide 30 14.1.3 Component development for reuse l Components for reuse may be specially constructed by generalising existing components l Component reusability … l There is a trade-off between reusability and usability.

31 ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14Slide 31 Reusable components l The development cost of reusable components is higher than the cost of specific equivalents. This extra reusability enhancement cost should be an organization rather than a project cost l Generic components may be less space-efficient and may have longer execution times than their specific equivalents

32 ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14Slide 32 Reusability enhancement l Name generalisation l Operation generalisation l Exception generalisation l Component certification

33 ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14Slide 33 Reusability enhancement process

34 ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14Slide 34 14.2 Application families l An application family or product line is a related set of applications that has a common, domain- specific architecture l The common core of the application family is reused each time a new application is required l Each specific application is specialised in some way

35 ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14Slide 35 Application family specialisation l Platform specialisation l Configuration specialisation l Functional specialisation

36 ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14Slide 36 Example: A resource management system

37 ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14Slide 37 Inventory management systems l Resource database Maintains details of the things that are being managed l I/O descriptions Describes the structures in the resource database and input and output formats that are used l Query level Provides functions implementing queries over the resources l Access interfaces A user interface and an application programming interface

38 ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14Slide 38 Application family architectures l Architectures must be structured in such a way to separate different sub-systems and to allow them to be modified l The architecture should also separate entities and their descriptions and the higher levels in the system access entities through descriptions rather than directly

39 ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14Slide 39 A library system

40 ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14Slide 40 Library system l The resources being managed are the books in the library l Additional domain-specific functionality (issue, borrow, etc.) must be added for this application

41 ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14Slide 41 Family member development

42 ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14Slide 42 Family member development l Elicit stakeholder requirements Use existing family member as a prototype l Choose closest-fit family member Find the family member that best meets the requirements l Re-negotiate requirements Adapt requirements as necessary to capabilities of the software l Adapt existing system Develop new modules and make changes for family member l Deliver new family member Document key features for further member development

43 ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14Slide 43 14.3 Design patterns l A design pattern is a way of reusing abstract knowledge about a problem and its solution l A pattern is a description of the problem and the essence of its solution – a well-tried solution to a common problem l It should be sufficiently abstract to be reused in different settings l Patterns often rely on object characteristics such as inheritance and polymorphism to provide generality

44 ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14Slide 44 Pattern elements l Name A meaningful pattern identifier l Problem description l Solution description Not a concrete design but a template for a design solution that can be instantiated in different ways l Consequences The results and trade-offs of applying the pattern

45 ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14Slide 45 Multiple displays

46 ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14Slide 46 The Observer pattern l Name Observer l Description Separates the display of object state from the object itself l Problem description Used when multiple displays of state are needed l Solution description See Figure 14.14 with UML description and Figure 14.12 with text l Consequences Optimisations to enhance display performance are impractical

47 ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14Slide 47 The Observer pattern

48 ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14Slide 48 Design Patterns Limitations l Hard to learn l Requires experienced developers

49 ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14Slide 49 l Design with reuse involves designing software around good design and existing components l Advantages are lower costs, faster software development and lower risks l Component-based software engineering relies on black-box components with defined requires and provides interfaces l COTS product reuse is concerned with the reuse of large, off-the-shelf systems Key points

50 ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14Slide 50 Key points l Software components for reuse should be independent, should reflect stable domain abstractions and should provide access to state through interface operations l Application families are related applications developed around a common core l Design patterns are high-level abstractions that document successful design solutions


Download ppt "©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14Slide 1 Design with Reuse l Building software from reusable components."

Similar presentations


Ads by Google