发信人: Dintern (.Net newbie), 信区: DotNet
标 题: Re: 你们最不喜欢.net的什么？
发信站: BBS 未名空间站 (Fri Mar 9 15:02:03 2007)
【 在 LifeAsWater (烟水寒) 的大作中提到: 】
: two bad things about delegate:
: 1. it is not type safe. it allows any methods which has the same
: signature to be a candidate even that method is not suppose to be.
It's not a type issue, because the name of a method is not a part
of a type.
: 2. no easy way to group delegate.
That's one granularity people sometimes prefer. In Java, if all I want
to implement is one event listener method, I still have to implement
the other ones in the interface either by hand or adapters. With
delegates, you work on the one you like and skip the others. There's
no need of interfaces at all here.
※ 来源:·BBS 未名空间站 http://mitbbs.com·[FROM: 204.128.]