Design mode behavior mode Behavioral Patterns FlexibleService mode

xiaoxiao2021-03-06  69

FlexibleService mode

--- Design mode behavior mode Behaviooral Patterns FlexibleService mode

intention

Poll the behavior from a parent class to the child class to dynamically use specific behaviors

Solution step

Using the Objectifier mode in the target class to provide a class hierarchy for a variable service component to add a Template Method mode Definition method to return a CONCRETESUBJECT object in the ConcreteSubject object in the ConcreteClient class in the ConcreteClient class in the ConcreteClient class. And return a ConcretService object.

in conclusion

Very easy to change and extended frames Design ConcreteClients fully controlled their specified services. When necessary, you can immediately change the service to get back to the method before calling the service. GetService (), add additional call overhead.

Related mode

Flexible Service is an Objectifier mode and a consortium of Template Method. Flexible Service is similar to bridge.

转载请注明原文地址:https://www.9cbs.com/read-87395.html

New Post(0)