Method chaining and the finishing problem

微笑、不失礼 提交于 2020-01-16 15:46:23

问题


are there any approaches, given a statement like the following

First().Second();

to know from within First() whether/when Second() has executed?

Reference: http://martinfowler.com/dslwip/MethodChaining.html


回答1:


Second() will not execute until First() has completed, therefore this is impossible. All that First() can do is to violate fluency, thereby making it impossible for Second() to run.



来源:https://stackoverflow.com/questions/2146623/method-chaining-and-the-finishing-problem

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!