BayeuxRouter Injection Need for Bayeux4Netty

Dai Jun guiwuu at gmail.com
Sun Sep 27 03:27:32 EDT 2009


Hi Trustin and Bob,

Sorry for my late response. I got a cold and was away from computer
for some days. But don't worry, it's not H1N1 and I already recover
from it:).

I like both of your ideas.

> On Sep 20, 2009, at 10:23 PM, Trustin Lee (이희승) wrote:
>
> To support the two cases above (extension or re-implementaiton), I
> think BayeuxRouter should be an interface and the current
> implementation should be renamed to something like
> 'DefaultBayeuxRouter'.
>
> And then, we need to allow a user to specify a BayeuxRouter
> implementation in the constructor.  The constructor argument could be
> optional so that the default router implementation is used if no
> router is specified.

+1. I'd like this idea. But I am not very clear how to do this
perfect. Because BayeuxConnection also depends on BayeuxRouter
besides BayeuxEncoder/Decoder. Of course, we also can specify it in
constructor of BayeuxConnection like in BayeuxDecoder/Encoder. But the
codes seem to be some redundant. Is there more beautiful way? Like IoC
container. Just a think, I am not familiar with it and looking forward
to your suggestions.

On Mon, Sep 21, 2009 at 9:38 PM, Bob McWhirter <bmcwhirt at redhat.com> wrote:
> Trustin, I think that'd be a perfect solution.
>
> Taking it a step further, I think I'd enjoy creating, even if only in
> my own codebase, an abstract handler that's more like HTTP Servlets.
> Instead of a general handling method, branch out into a doSubscribe(),
> doUnsubscribe(), doConnect() etc type of methods.  Then the default
> handler could have a default implementation for doSubscribe() which
> could be overriden by subclasses if they wanted to do more.

Cool idea, it helps a lot. I'd like to add it ASAP.
AbstractBayeuxHandler should be a suggestion way to develop Bayeux
APPs. Users also are able to directly use BayeuxEncoder/Decoder in
Netty's upstream/downstream chain. Do you agree?

>
>        -Bob
>
>

Best regards,

Dai Jun or Danny Dai(in English) - http://guiwuu.googlepages.com
GTalk: guiwuu at gmail.com | QQ: 93409048 | MSN: guiwuu at hotmail.com |
Twitter: @guiwuu

Samuel Goldwyn  - "I'm willing to admit that I may not always be
right, but I am never wrong." -
http://www.brainyquote.com/quotes/authors/s/samuel_goldwyn.html



More information about the netty-dev mailing list