05
3

委托和接口的选择

0
归档:2025年3月分类:C#和.NET
内容纲要

A delegate design might be a better choice than an interface
design if one or more of these conditions are true:
• The interface defines only a single method.
• Multicast capability is needed.
• The subscriber needs to implement the interface multiple times.

如果满足以下一个或多个条件,委托设计可能比接口设计更好:
• 接口仅定义一个方法。
• 需要多播功能。
• 订阅者需要多次实现该接口。


声明: 本文采用 BY-NC-SA 协议进行授权. 未标注“转”的文章均为原创,转载请注明转自: 委托和接口的选择

公告栏

欢迎大家来到我的博客,我是dodoro,希望我的博客能给你带来帮助。