11
Guava開発者が注釈を使用することを選択した注釈対インタフェースグアバでEventBus
class EventBusChangeRecorder implements Handler<ChangeEvent>{
void handle(ChangeEvent e) {
recordChange(e.getChange());
}
}
これは時間不可能チェックをコンパイルします。だから私はこのアプローチの利点は何か不思議です。
ここでアノテーションの利点がありますか?
ありがとうございました。それはまさに私が探していたものです。 – deamon
更新されたリンク:https://github.com/google/guava/wiki/EventBusExplained#why-use-an-annotation-to-mark-handler-methods-rather-than-requiring-the-listener-to-implement-インタフェース – wanghq