23.07.2012 Views

Design Patterns Explained

Design Patterns Explained

Design Patterns Explained

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

26 Part I An Introduction to Object-Oriented Software Development<br />

in Java as they are in C++. In C++, it is common for an object’s<br />

destructor also to destroy other objects that are used only by this<br />

object.<br />

Summary<br />

In this chapter In this chapter, I have shown how object orientation helps us minimize<br />

consequences of shifting requirements on a system and how it<br />

contrasts with functional decomposition.<br />

Table 1-3 Object-Oriented Concepts<br />

Concept Review<br />

Functional<br />

decomposition<br />

Changing<br />

requirements<br />

I covered a number of the essential concepts in object-oriented programming<br />

and have introduced and described the primary terminology.<br />

These are essential to understanding the concepts in the rest<br />

of this book. (See Tables 1-3 and 1-4.)<br />

Structured programmers usually approach program design with functional<br />

decomposition. Functional decomposition is the method of breaking down<br />

a problem into smaller and smaller functions. Each function is subdivided<br />

until it is manageable.<br />

Changing requirements are inherent to the development process. Rather<br />

than blaming users or ourselves about the seemingly impossible task of<br />

getting good and complete requirements, we should use development<br />

methods that deal with changing requirements more effectively.<br />

Objects Objects are defined by their responsibilities. Objects simplify the tasks of<br />

programs that use them by being responsible for themselves.<br />

Constructors and<br />

destructors<br />

An object has special methods that are called when it is created and<br />

deleted. These special methods are:<br />

Constructors, which initialize or set up an object.<br />

Destructors, which clean up an object when it is deleted.<br />

All object-oriented languages use constructors and destructors to help<br />

manage objects.

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

Saved successfully!

Ooh no, something went wrong!