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.

Supplement: C++ Code Example<br />

Example 7-2 C++ Code Fragments: Implementing the Adapter Pattern<br />

class Circle : public Shape {<br />

private:<br />

XXCircle *pxc;<br />

}<br />

Circle::Circle () {<br />

pxc= new XXCircle;<br />

}<br />

void Circle::display ()<br />

{ pxc->displayIt();<br />

}<br />

Chapter 7 • The Adapter Pattern 1O7

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

Saved successfully!

Ooh no, something went wrong!