1 / 32

Chapter 14

Chapter 14. Design with Reuse. Objectives. To explain the benefits and some potential problems with software reuse. To describe different types of reusable elements and processes for reuse. To introduce application families as a route to reuse.

makala
Download Presentation

Chapter 14

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 14 Design with Reuse

  2. Objectives • To explain the benefits and some potential problems with software reuse. • To describe different types of reusable elements and processes for reuse. • To introduce application families as a route to reuse. • To describe design patterns as high-level abstractions that promote reuse.

  3. Topics covered • Component-based development • Application families • Design patterns

  4. Topics / sections we will skip • Generator-based reuse (pp. 309-310) • 14.1.1 – 14.1.3 (pp. 314-318) • Application frameworks • COTS product reuse • Component development for reuse

  5. Reuse-based software engineering • In mostengineering disciplines, systemsare routinely designed by composing elements that have been used in other systems. • This hasnot been true in SE, but to reduce risksand accelerate develop-ment, it is now recognized that we need to adopt design processes based on systematic reuse. (whether opportunisticor reuse-driven)

  6. Software reuse practice • Application systemreuse –widely practised as software systems are implemented as application families. COTS reuse is becoming increasingly common. • Componentreuse–now seen as the key to effective and widespread reuse through Component-Based Software Engineering (CBSE). However, it is still relatively immature. • Functionreuse –libraries of reusable functions have been common for 40 years. • Design Pattern reuse– a way of reusing “accumulated knowledge and wisdom” about a problem and its solution. Closely tied to OO design principles. Requires relatively sophisticated design skills, so use is limited.

  7. Benefits of reuse • Increased reliability– when reused elements have been tried and tested in a variety of working systems. • Reduced process risk– less uncertainty of cost compared to new development. • More effective use of specialists – re-use elements instead of experts.

  8. Benefits of reuse (cont.) • Standards compliance – when standards are embedded in reusable elements. • Accelerated development – reduced developmentandvalidation time. (usually…)

  9. Requirements for design with reuse • Must be possible tofindappropriate reusable elements. • Must be confident that the elements will be reliable and will behave as specified. • Elements must be documented so that they can be understood and, when necessary, modified.

  10. General Reuse problems • Increased maintenance costs – especially if source code / documentation absent.(otherwise, could be much lower) • Lack of tool support – CASE toolsets do not support development with reuse. (What support could be provided?) • Not-invented-here syndrome – the resistance against using “someone else’s” code.

  11. General Reuse problems (cont.) • Repositories of reusable elements – techniques for classifying, cataloguing, and retrieving elements are immature. • Difficulty of finding, understanding, and adapting reusable elements –this takes time.

  12. Component-based development • Component-Based Software Engineering (CBSE) is a development approach based on systematic reuse. • CBSE emerged in the late 1990’s due to failure of OO development(alone) to lead to extensive reuse. • Components are designed to be general service providers. • A multi-level paradigm: “components” may implement a single function or an entire system.

  13. Critical characteristics of a reusable component • An independent executable entity:source code is typically not available so the component is not compiled with other system elements. • All interactions are through a published(2-part) interface – internal state is never exposed. What are some of the practical effects of these characteristics?

  14. 2-part component interface • “Provides interface” – defines the services that areprovided by the component to other system elements. • “Requires interface” – defines the servicesthat must be made available to the component by other system elements in order to operate.

  15. 2-part component interface

  16. Printing services component Printer Description Control Interface How does this compare to a “normal object” interface?

  17. Component abstraction levels • Functional abstraction – implements a single function (e.g., square root) • Casual groupings –loosely related entities such as data declarations and functions • Data abstractions – a data abstraction or object class • Cluster abstractions – related object classes that work together • System abstraction – an entire, self-contained system (e.g., MS Excel)

  18. CBSE processes • Component-based reuse may be opportunistic, or it may drive the development process. • In reuse-driven development, system requirements are modified to reflect the available components. • CBSE often involves an evolutionary development process with components being “glued together” using a scripting language.(e.g., Unix shell, Visual Basic, TCL/TK)

  19. An opportunistic reuse process Developed in Brooklyn? the “we might get lucky” approach

  20. Reuse-driven development

  21. CBSE problems • Component incompatibilities: may mean that cost and schedule savings are less than expected. (at best…) • Managing evolution as requirements change: source code is typically not available. (“waiting for the next release”) Plus the general reuse problems discussed previously, such as finding and understanding components, poor tool support, etc.

  22. Application families • An application family or product line is a related set of applications that has a common, domain-specific architecture. • The common core of the application family is reused each time a new application is required. • Each specific application is specialized in some way.

  23. Application family specialization • Platform specialization – different versions of the application are developed for different platforms. (e.g., Windows, Sun OS, Linux) • Configuration specialization – different versions of the application are created to handle different peripheral devices. (I/O devices, etc.) • Functional specialization – different versions of the application are created for customers with different requirements. (e.g., Word users vs. PowerPoint users)

  24. Family member development Use existing family member as prototype.

  25. Design patterns (Alexander, mid-70’s) • A way of reusing “accumulated knowledge and wisdom” about a problem and its solution. • A design pattern is a description of some problem and the essenceof its solution. • Should be sufficiently abstract to be reusable in different contexts. • Often utilize OO characteristics such as inheritance and polymorphism.

  26. Pattern elements (Gamma, ‘95) • Name:a meaningful pattern identifier • Problem description • Solution description:a template for a design solution that can be instantiated in different operational contexts (often illustrated graphically) • Consequences:the results and trade-offs of applying the pattern (analysis and experience)

  27. The Observer pattern (Details: p. 323) • Name:Observer • Description:Separates the display of object state from the object itself. • Problem description:Used when multiple displays of state are needed. • Solution description:See UML description • Consequences:Optimizations to enhance (individual) display performance are impractical.

  28. Multiple displays

  29. The Observer pattern Observer attribute super class Subject super class Specific observer sub-class Specific subject sub-class

  30. Key points • Design with reuse involves designing software around existing examples of good design and making use of existing software elements. • (Potential) advantages are lower costs, faster development, and lower risks. • CBSE relies on black-box components with defined requires- and provides- interfaces.

  31. Key points but general/flexible • Software components for reuse should be independent,reflect stable domain abstractions, and provide access to state through interface operations (only?). • COTS product reuse is concerned with the reuse of large-scale, off-the-shelf systems.

  32. Key points • Application families are related applications that have a common, domain-specific architecture. • Design patterns are high-level abstractions that document successful design solutions.

More Related