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.

Chapter 4 • A Standard Object-Oriented Solution 59<br />

• visiot would be implemented by remembering the model it<br />

belongs to and its ID in the V1 system when it is instantiated.<br />

Then, whenever one of the visiot methods is called to get<br />

information about it, the method would have to call a sequence<br />

of subroutine calls in V1 to get that information.<br />

• V2Slot would be implemented in a similar fashion, except<br />

that, in this case, each V2Slot object would contain the slot<br />

object corresponding to it in the V2 sys tem. Then, whenever<br />

the object was asked for information, it would simply pass this<br />

request on to the OOGSlot object and pass the response back to<br />

the client object that originally requested it.<br />

A more detailed diagram incorporating the V1 and V2 systems is<br />

shown in Figure 4-3.<br />

Figure 4-3 A first solution.

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

Saved successfully!

Ooh no, something went wrong!