1.词汇
- delegate type 委托类型
- delegate instance 委托实例
- interface 接口
2.例句
-
I’m sure you already have an instinctive idea about what a delegate is, even though it can be hard to articulate. Essentially,delegates provide a level of indirection: instead of specifying behavior to be executed immediately, the behavior can somehow be “contained” in an object. That object can then be used like any other, and one operation you can perform with it is to execute the encapsulated action. Alternatively, you can think of a delegate type as a singlemethod interface, and a delegate instance as an object implementing that interface.
可以肯定,你对委托delegate有了直观的认识,即使此时你无法清晰的描述出来。实际上,委托在某种程度上提供了间接的方法:不需要直接指定一个要立即执行的行为,而是将这个行为包裹在对象里,这个对象可以像其他对象那样使用,在该对象中可以执行封装的操作。换言之,可以将委托类型当做只定义了一个方法的接口,而委托实例当做是实现了该接口的一个对象