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.

254 Part V • Handling Variations with <strong>Design</strong> <strong>Patterns</strong><br />

Example 15-2 C++ Code Fragments (continued)<br />

Component *myST;<br />

// Get chain of Decorators and SalesTicket built by<br />

// another object that knows the rules to use.<br />

// This may be done in constructor instead of<br />

// each time this is called.<br />

myST= Configuration.getSalesTicket()<br />

// Print Ticket with headers and footers as needed<br />

myST->prtTicket(); }

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

Saved successfully!

Ooh no, something went wrong!