Closed GoogleCodeExporter closed 9 years ago
The current implementation of the lazy registry need to be reworked, though. As
it is,
it will create a new instance of the handler every time it is needed, unless
its
explicitely marked as @Singleton.
Original comment by philippe.beaudoin
on 23 Apr 2010 at 11:31
Something that would simplifies things a lot is to bind validator at startup
instead
of lazily instantiate them.
There is two question I asked myself to come to this conclusion. How many
validators
I user would likely have ? 2-3 max. Personnaly I use two secure context and one
unsecure. Admins, users, guest.
Second questin, are validators expensive to create ? Not really. Maybe a right
system
would be more expensive to create, but even then, we don't do any validation
when the
class is first loaded. So every "expensive" action are done while validating
the user
action through execute.
Original comment by goudreau...@gmail.com
on 24 Apr 2010 at 12:33
Yes, I'm not convinced lazy validators are required. It probably make sense for
actions, though, as there will likely be a lot and you want to reduce cold
start, so
I still want to figure a nicer solution than the actual one, which is "all
lazy" or
"all standard".
Here is another possible cleanup:
Right now, DispatchModule.bindHandler() binds multiple objects to
ActionHandlerMap
(via a UniqueAnnotations). The Linker then uses injector.findBindingsByType to
identify all the ActionHandlerMap bindings and register them with the registry.
There is probably a way to get rid of this double process and register objects
directly in bindHandler()... Although it might force us to _only_ use lazy
validators
and lazy handlers. If we really want nonlazy, then the linker could simply go
through
the list of registered handlers/validators and instantiate the nonlazy ones.
I.e.
Everything would be lazy, but some lazy would be instantiated at app start.
Original comment by philippe.beaudoin
on 24 Apr 2010 at 5:08
I really think uniqueAnnotation is something we must keep. With that, we can
bind every
different action to every different actionhandler while using the same
Interface for
every single one of them while keeping the right binding.
If we get rid of that, how would you do that instead ?
Original comment by goudreau...@gmail.com
on 24 Apr 2010 at 6:46
The unique annotation is just a way to pass information from the binder to the
linker.
I don't think it's the best way to do this, and David Peterson seems to agree:
http://groups.google.com/group/gwt-dispatch/browse_frm/thread/ce1dd9c91d9e0b4b
Original comment by philippe.beaudoin
on 24 Apr 2010 at 6:55
Original comment by goudreau...@gmail.com
on 17 May 2010 at 12:03
Original comment by goudreau...@gmail.com
on 18 May 2010 at 6:45
Original comment by goudreau...@gmail.com
on 18 May 2010 at 6:52
Original comment by goudreau...@gmail.com
on 25 May 2010 at 6:39
Original issue reported on code.google.com by
philippe.beaudoin
on 23 Apr 2010 at 11:21