August 2009
Intermediate to advanced
281 pages
6h 50m
English
This Unified Modified Language (UML) diagram (see Figure 17-1) and following list detail a class design using the Strategy Design Pattern.
MyObject contains a public property called name. This represents the property of MyObject that normally accepts modification. The public method setName() receives one parameter, called name. This is assigned to the MyObject name property.
MyObjectStrategy is the self-contained algorithm object. It has one public method, named change(). This accepts a parameter of MyObject. change() and executes that specific logic against the MyObject by modifying its public name variable.
Read now
Unlock full access