ActionScript 3.0 Design Patterns

(Chris Devlin) #1
Key OOP Concepts Used with the Symmetric Proxy | 475

The only real difference between Figure 13-4 and Figure 13-3 is that the proxy and


players are placed into single objects and the details of the Internet are spelled out a


bit more in the latter. The same model could be used another way to send the


proxy’s move such as PHP, ColdFusion, or any other mechanism for sending infor-


mation over the Internet. (Axel Schreiner commented that you could use smoke sig-


nals—the method of sending information over the network is immaterial.)


The one thing we don’t particularly like about the androgynous variation on the


Symmetric Proxy is the loss of granularity in the model. By placing the proxy move


method in the same object as the real player, we collapse the real and proxy in a way


that may not be easily adaptable to other games. At this point, though, no clear dis-


advantage is apparent. Both players are perfectly symmetrical, and the variation


maintains the role of the referee.


Key OOP Concepts Used with the Symmetric Proxy


For a compound design, all the OOP concepts we have discussed for the different


design patterns collected in a single compound design apply. So, to avoid repeating


the same key concepts discussed in the chapters where the compounding elements


Figure 13-4. Androgynous variation of Symmetric Proxy


Player1 Proxy2

Referee 1

Internet

Shared object

Internet

Proxy1 Player2

Referee 2
Free download pdf