I find the client-server distinction too coarse to work with. The
strength of gwt is at least partly in the RPC mechanism and passing
full classes.
I was therefore wondering. Isn't it possible to declare a specific
function or inner class if that's easier to only be accessible on the
server side ? I realize this poses all sorts of problems for variables
and deciding whether or not something gets serialized, but I'd be most
happy if the compiler just threw those problems in my face and
expected me to fix them.
I realize server-side there can be only one class definition. But I'd
like to "opt-out" of translating compiling specific functions, and
just get an error message if that function is used by any client code.
What I'm really looking for is something like this, and this would be
an example usage :
class getServerTimeCommand implements Command {
Date d;
@ServerOnly
public void execute() {
d = new Date();
}
// whoops no ServerOnly, yet calls a ServerOnly function
public void doItAnyway() {
execute(); // ERROR, attempting to call serverside code from
within client code
}
}
Is it possible to do something like this ? If not, would it be
possible to implement it ? It would be extremely handy for reducing
the number of classes needed in RPC. I basically want the ability to
say about certain class members "please don't serialize this".
I realize that for certain data fields you have problems, since not
passing them to the client side requires keeping track of references,
however I think you can avoid that problem by allowing only functions
to do this. This would also enormously simplify the usage of various
java tools both server- and client-side.
Christophe
--
"Flying is simply learning how to throw yourself at the ground and
miss." - Douglas Adams
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---