方法链接和整理问题 [英] Method chaining and the finishing problem

查看:64
本文介绍了方法链接和整理问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有任何方法,给出如下语句

  First()。Second(); 

可以从 First()中了解/何时执行 Second()



参考: http://martinfowler.com/dslwip/MethodChaining.html

解决方案

Second() First()完成之前不会执行,因此这是不可能的。 First()所能做的就是违反流利性,从而使 Second()无法运行。 / p>

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

解决方案

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.

这篇关于方法链接和整理问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆