dev@grizzly.java.net

Re: [Grizzly2.0 - Issue 2] No Controller?

From: Oleksiy Stashok <Oleksiy.Stashok_at_Sun.COM>
Date: Thu, 19 Jun 2008 18:36:53 +0200

>>>
>>> With Alexey's proposal, we will have to explicitly set those to
>>> each transport implementation if we want to share component. With
>>> the current Controller, I suspect this is simpler/less code to
>>> manage. Also, is the Controller name that confusing so we want to
>>> rename it TransportManager? I guess yes :-)
>> During the meeting I agree, that we need to have something like
>> Controller to share what is possible to share among different
>> transports.
>> Though I think this class should be optional to use - just in case
>> of several transports.
> But I need someplace to create an instance of a transport. Why not
> do this in the
> TransportManager? Something like:
>
> TransportManager.makeXXXTransport( ... )
>
> or
>
> TransportManager.instance().makeXXXTransport( ... )
>
> I'd rather avoid explicit calls to new to create a transport:
> new always requires creating a new instance, whereas factory
> methods can be more flexible.
I agree with idea you have such a factory, just have 2 concerns:
1) should we have "make" method for each transport?
2) If developer will want to extend existing transport or implement
new one - he will need also provide own TransportManager implementation?

On other side we can add one more method:
TransportManager.instance().makeTransportByName(Class<? extends
Transport>) or something like that.

anyway, IMHO, it makes sense to have both possibilities:
TransportManager & "new", cause for simple usecases, IMHO, it's easier
and more clear to use "new".

Thanks.

WBR,
Alexey.

>
>
> Thanks,
>
> Ken.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_grizzly.dev.java.net
> For additional commands, e-mail: dev-help_at_grizzly.dev.java.net
>