We've been using GWT with Spring/Hibernate/GXT for over a year. Loving
every day of it.

I would like to start contributing to the project to remove little and
big annoyances and to make it better overall. First little annoyance
on the list - lots of final and private methods in
RemoteServiceServlet, which force us into creating ugly hacks that I'd
like to avoid.

First, description of the problem. We have a service-oriented
architecture where GWT client invokes various services. Services are
annotated classes that extend RemoteServiceServlet and are managed by
Spring through AOP. One service can invoke another service as well.

The first problem was encountered with 1 service invoking the other.
RemoteServiceServlet stores HttpRequest in a thread local, and
provides method getThreadLocalRequest(). This works well when a client
calls the service, but does not work when one service calls another
since each service ends up with it's own thread local instance (they
share the thread, but not the instance) and the callee has a null
request.

I don't know why RemoteServiceServlets do not share one thread local.
Actually, that would be the cleanest fix IMHO.

If that cannot be done, at least we could have overridden
getThreadLocalRequest() had it not been declared final. The thread
local variable is private instead of protected, so there is absolutely
not clean way of fixing this.

I am also running into the same problem when trying to use
serialization from file upload request, which doesn't go through
RemoveServiceServlet.doPost() method. Long story why, but I run into
null pointer exception in getSerializationPolicy() because
getThreadLocalRequest() returns null. Of course, getSerializationPolicy
() is final so I can't fix that either!

What is the obsession with private variables and final methods? I saw
a lot of posts on in groups where people are trying to extend the
functionality and final methods prove to be stumbling blocks.

What I would like to see is:

1. Have RemoveServiceServlet share HttpRequest if called from the same
thread
2. Make final methods of RemoveServiceServlet non-final to provide
flexibility to users

I am willing to contribute the changes and discuss ideas of course.

--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---

Reply via email to