23.11.2014 Views

Data Structures and Algorithms in Java[1].pdf - Fulvio Frisone

Data Structures and Algorithms in Java[1].pdf - Fulvio Frisone

Data Structures and Algorithms in Java[1].pdf - Fulvio Frisone

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

severely overdosed six patients between 1985 <strong>and</strong> 1987, some of whom died from<br />

complications result<strong>in</strong>g from their radiation overdose. All six accidents were<br />

traced to software errors.<br />

Adaptability<br />

Modern software applications, such as Web browsers <strong>and</strong> Internet search eng<strong>in</strong>es,<br />

typically <strong>in</strong>volve large programs that are used for many years. Software,<br />

therefore, needs to be able to evolve over time <strong>in</strong> response to chang<strong>in</strong>g conditions<br />

<strong>in</strong> its environment. Thus, another important goal of quality software is that it<br />

achieves adaptability (also called evolvability). Related to this concept is<br />

portability, which is the ability of software to run with m<strong>in</strong>imal change on<br />

different hardware <strong>and</strong> operat<strong>in</strong>g system platforms. An advantage of writ<strong>in</strong>g<br />

software <strong>in</strong> <strong>Java</strong> is the portability provided by the language itself.<br />

Reusability<br />

Go<strong>in</strong>g h<strong>and</strong> <strong>in</strong> h<strong>and</strong> with adaptability is the desire that software be reusable, that<br />

is, the same code should be usable as a component of different systems <strong>in</strong> various<br />

applications. Develop<strong>in</strong>g quality software can be an expensive enterprise, <strong>and</strong> its<br />

cost can be offset somewhat if the software is designed <strong>in</strong> a way that makes it<br />

easily reusable <strong>in</strong> future applications. Such reuse should be done with care,<br />

however, for one of the major sources of software errors <strong>in</strong> the Therac-25 came<br />

from <strong>in</strong>appropriate reuse of software from the Therac-20 (which was not objectoriented<br />

<strong>and</strong> not designed for the hardware platform used with the Therac-25).<br />

2.1.2 Object-Oriented Design Pr<strong>in</strong>ciples<br />

Chief among the pr<strong>in</strong>ciples of the object-oriented approach, which are <strong>in</strong>tended to<br />

facilitate the goals outl<strong>in</strong>ed above, are the follow<strong>in</strong>g (see Figure 2.2):<br />

• Abstraction<br />

• Encapsulation<br />

• Modularity.<br />

Figure 2.2<br />

: Pr<strong>in</strong>ciples of object-oriented design.<br />

92

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!