23.07.2012 Views

Design Patterns Explained

Design Patterns Explained

Design Patterns Explained

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

He defines it as part of his constraints:<br />

The system (code and tests together) must communicate<br />

everything you want to communicate.<br />

The system must contain no duplicate code. (1 and 2<br />

together constitute the Once and Only Once rule).<br />

Figure 9-13 illustrates the separation of the Shape abstraction from<br />

the Drawing implementation.<br />

Figure 9-13 Class diagram illustrating separation of abstraction and<br />

implementation.<br />

From a method point of view, this looks fairly similar to the inheritance-based<br />

implementation (such as shown in Figure 9-3). The biggest<br />

difference is that the methods are now located in different<br />

objects.<br />

Chapter 9 The Bridge Pattern 145<br />

The pattern<br />

llustrated<br />

Relating this to the<br />

inheritance-based<br />

design

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

Saved successfully!

Ooh no, something went wrong!