委托帮助子类去实现它的责任,你想委托某一个帮助子类来局部化信息。
Classes delegate responsibility to one of several helper subclasses, and you want to localize the knowledge of which helper subclass is the delegate.
这帮助减少可能性的bug数:所有的子类被要求去做,满足了一个清晰的职责。
This helps to reduce the likelihood of bugs: all subclasses are required to do, is fulfill a clear contract.
应用推荐