Check out the new USENIX Web site. next up previous
Next: Extending the BAST Framework Up: Strategy Pattern in BAST Previous: Overview of the Protocol.

Recursive Use of the Strategy Pattern

When solving distributed problem tex2html_wrap_inline777, one can strictly focus on the interaction between class tex2html_wrap_inline777 Object and class tex2html_wrap_inline777 Algo, while forgetting about how other protocols are implemented. In particular, all protocols needed to support protocol tex2html_wrap_inline777 are transparently used through inherited services of class tex2html_wrap_inline777 Object. Those services might also be implemented applying the Strategy pattern, but this is transparently managed by inherited operations of tex2html_wrap_inline777 Object. In that sense, BAST uses the Strategy pattern in a powerful recursive manner.

The recursive use of the Strategy pattern is illustrated in Figure 4. The latter schematically presents a possible implementation of protocol class CSSObject presented in Section 3.1, which enables to solve the distributed consensus problem by providing operations propose() and decide(). On this Figure, the gray oval is context class CSSObject, while inner white circles are various tex2html_wrap_inline777 Algo strategy classes (tex2html_wrap_inline777 being different protocols). Arrows show the connections between provided services (top) and required services (bottom) of each strategy class. Operations provided by class CSSObject are grouped on the application layer side (top). Each strategy class pictured in Figure 4 is managed by the corresponding context class in the protocol class hierarchy presented in Figure 1 (b).

Figure 4: Recursive use of the Strategy pattern

Wed May 14 17:28:46 MET DST 1997