Presentation is loading. Please wait.

Presentation is loading. Please wait.

Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 3: Basing Software Development on Reusable Technology.

Similar presentations


Presentation on theme: "Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 3: Basing Software Development on Reusable Technology."— Presentation transcript:

1 Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 3: Basing Software Development on Reusable Technology

2 © Lethbridge/Laganière 2001 Chap. 3: Basing Development on Reusable Technology 2 3.1 Building on the Experience of Others Software engineers should avoid re-developing software already developed Desirable to make designs reusable and document these efforts so that the artifact is flexible to be used in a variety of situations. Here are some examples:

3 © Lethbridge/Laganière 2001 Chap. 3: Basing Development on Reusable Technology 3 Examples of Reuse Types of reuse: Reuse of expertise —There is never NEVER any substitute for experience. —Can’t get it from books; only from experience. —Lessons learned are invaluable and are quite reusable. Reuse of standard designs and algorithms —Numerous designs that can be reused -Architectural patterns -Design patterns -Reusable specifications even. Reuse of libraries of classes or procedures —Huge libraries of reusable subroutines, subprograms, data structures, classes, powerful commands, and much more.

4 © Lethbridge/Laganière 2001 Chap. 3: Basing Development on Reusable Technology 4 Examples of Reuse Types of reuse: Reuse of complete applications Examples: —Rseusing a Military Pay application for a similar application, Civilian Pay. —Often complete applications can be reused and enhanced in needed parts. —Done all the time! No sense in reinventing the wheel. Prime example is COTS software – Commercial off-the-shelf. But be careful here. —The additional code needed may obviate the gain from using COTS software. —Liabilities must be very carefully developed too. —Really, an entire separate subject – and deservedly so.

5 © Lethbridge/Laganière 2001 Chap. 3: Basing Development on Reusable Technology 5 Examples of Reuse Types of reuse: Reuse of frameworks – and this is what we are after here. Frameworks represent an entire structure of an application – with some facilities present for reuse and others that must be added to make the framework usable. Some are quite detailed and only a few key missing parts may need to be added. Others require wholesale importing of parts – key parts to make the framework useful. Different kinds of frameworks too.

6 © Lethbridge/Laganière 2001 Chap. 3: Basing Development on Reusable Technology 6 3.2 Reusability and Reuse in SE Reuse and design for reusability should be part of the culture of software development organizations But there are problems to overcome: Many organizations do not practice reuse More comfortable starting from scratch, or Non-availability of reusable components. Interestingly, many are willing to use existing reusable components! Often, deadlines do not permit the additional time needed to produce quality, reusable components!

7 © Lethbridge/Laganière 2001 Chap. 3: Basing Development on Reusable Technology 7 Reuse and design for reusability should be part of the culture of software development organizations There are serious management and technical problems to overcome: Why take the extra time needed to develop something that will benefit other projects/customers? Management may only reward the efforts of people who create the visible ‘final products’. Reusable software is often created in a hurry and without enough attention to quality. There is absolutely more care needed to create reusable components – testing and verification before being placed into a library for common use…

8 © Lethbridge/Laganière 2001 Chap. 3: Basing Development on Reusable Technology 8 A vicious cycle Developers thus tend not develop high quality reusable components, and so there is often little to reuse To solve the problem, recognize that: This vicious cycle costs money Investment in reusable code is important – but few want to do it now! Attention to quality of reusable components is essential —So that potential reusers have confidence in them —The quality of a software product is only as good as its lowest-quality reusable component Developing reusable components can often simplify design

9 © Lethbridge/Laganière 2001 Chap. 3: Basing Development on Reusable Technology 9 3.3 Frameworks: Reusable Subsystems A framework is reusable software that implements a generic solution to a generalized problem. It provides common facilities applicable to different application programs. Principle: Applications that do different, but related, things tend to have quite similar designs

10 © Lethbridge/Laganière 2001 Chap. 3: Basing Development on Reusable Technology 10 Frameworks to promote reuse A framework is intrinsically incomplete Certain classes or methods are used by the framework, but are missing (slots) —These MUST be completed in order to use the framework. —Missing pieces are called slots. —The more slots that need to be filled, the more complex the framework becomes -On the other hand, if a large number of slots need to be filled, then the framework tends to be more flexible to needs and hence reusable.

11 © Lethbridge/Laganière 2001 Chap. 3: Basing Development on Reusable Technology 11 Frameworks to promote reuse A framework is intrinsically incomplete Some functionality is optional — Allowance is made for developer to provide it (hooks) Developers use the services that the framework provides —Taken together the services are called the Application Program Interface (API) Users of frameworks are really reusing the design and code the original designers of the framework envisioned.

12 © Lethbridge/Laganière 2001 Chap. 3: Basing Development on Reusable Technology 12 Object-oriented frameworks In the object oriented paradigm, a framework is composed of a library of classes. We are all familiar with these… The API is defined by the set of all public methods of these classes. Some of the classes will normally be abstract

13 © Lethbridge/Laganière 2001 Chap. 3: Basing Development on Reusable Technology 13 Examples of frameworks A framework for payroll management A framework for frequent buyer clubs A framework for university registration A framework for e-commerce web sites In a given framework, there will be required an amount of work to make it usable – and this amount can vary as discussed. But the common thread is that a good deal of all frameworks, say the one for payroll management, do provide code for many common functions across the spectrum of payroll management systems. This is precisely what we are trying to exploit.

14 © Lethbridge/Laganière 2001 Chap. 3: Basing Development on Reusable Technology 14 Types of frameworks A horizontal framework provides general application facilities that a large number of applications can use Application Horizontal framework Code to be provided to adapt the framework to the needs of the application Services offered by the framework

15 © Lethbridge/Laganière 2001 Chap. 3: Basing Development on Reusable Technology 15 Types of frameworks A vertical framework (application framework) is more ‘complete’ but still needs some slots to be filled to adapt it to specific application needs Vertical frameworks are much more specific in applicability. Generally fewer slots and hooks Extreme example of a horizontal framework: an interface in Java – has no implementation and ALL slots must be filled. Most developers will only use a subset of the facilities available in the framework. Application Vertical framework Code to be provided to adapt the framework to the needs of the application Services offered by the framework

16 © Lethbridge/Laganière 2001 Chap. 3: Basing Development on Reusable Technology 16 All this is best shown by example.


Download ppt "Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 3: Basing Software Development on Reusable Technology."

Similar presentations


Ads by Google