1

Given the nature of the following, what is the best name for the interface? and if applicable which design pattern is this?

public interface ITestEvent??? {   // Handler / Listener / Observer / Emitter / ???

    void OnBeginTesting(ITestContext context);
    void OnException(Exception ex);
    void OnEndTesting();

}

public class MyTestEvent??? : ITestEvent { ... }

Tester.Add???(new MyTestEvent???());
4

1 回答 1

2

最初我觉得它是Command,你正在封装一个测试请求,并使用 Tester.Add() 调用/排队它。

但是经过您的反馈,我意识到您只是传递行为;所以我同意@kabram 的观点,这是Delegate.

于 2013-02-06T02:40:51.963 回答