You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@reef.apache.org by Markus Weimer <ma...@weimo.de> on 2015/07/01 17:58:18 UTC

Re: [Discuss] Observer vs. THandler

On 2015-06-28 21:52, Yingda Chen wrote:
> I was going to propose the same thing for C# as Gon: provide another
> interface layer on top of IObserver and implement the default OnError and
> OnComplete method would suffice for solving the problem.

Yes, that does work. However, it constrains the application code to not
inherit from any other class in their event handlers.

We could, of course, just make a new interface `IEventHandler<T>` just
like we did in Java. That way, the application code would be almost as
legible as with what I proposed: `onError()` and `onComplete()` would
disappear, bit the event handling methods are still all called `onNext()`.

Markus