PHP Objects, Patterns and Practice (3rd edition)

(Barry) #1
CHAPTER 6 ■ OBJECTS AND DESIGN

■Note Look at Figures 6–16 and 6–20. Notice how the class diagram illustrates polymorphism, showing the


classes derived from ShopProductWriter and ShopProduct. Now notice how this detail becomes transparent


when we model the communication among objects. Where possible, we want objects to work with the most


general types available so that we can hide the details of implementation.


Summary


In this chapter, I went beyond the nuts and bolts of object-oriented programming to look at some
key design issues. I examined features such as encapsulation, loose coupling, and cohesion that are
essential aspects of a flexible and reusable object-oriented system. I went on to look at the UML, laying
groundwork that will be essential in working with patterns later in the book.

Free download pdf