开发者

How java.util.Time.scheduleXXX() behave as a Mediator Pattern?

开发者 https://www.devze.com 2023-03-16 22:50 出处:网络
How java.util.Time.schedulexxx() behave as a Mediator Design Pattern?Please e开发者_如何学Cxpain it with example.Mediator pattern is recognizeable by behavioral methods taking an instance of different

How java.util.Time.schedulexxx() behave as a Mediator Design Pattern?Please e开发者_如何学Cxpain it with example.


Mediator pattern is recognizeable by behavioral methods taking an instance of different abstract/interface type (usually using the command pattern) which delegates/uses the given instance.

So here in this case Time instance is using scheduleXXX() method with different interface which is TimerTask and it is given as a argument to this scheduleXXX method and hence it is called mediator.

0

精彩评论

暂无评论...
验证码 换一张
取 消