【问题标题】:Method chaining and the finishing problem方法链和整理问题
【发布时间】:2010-01-27 12:00:12
【问题描述】:

有什么方法吗,给出如下声明

First().Second();

First() 内部了解Second() 是否/何时执行?

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

【问题讨论】:

    标签: dsl fluent method-chaining


    【解决方案1】:

    Second()First() 完成之前不会执行,因此这是不可能的。 First()所能做的就是破坏流畅度,从而使Second()无法运行。

    【讨论】:

    • 不过,我不会说不可能。我想知道是否使用 CallContext 或线程有一个干净的方法来实现它。
    猜你喜欢
    • 2021-05-23
    • 1970-01-01
    • 2011-08-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-08-07
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多