Hacker News new | ask | show | jobs
by prohor 4162 days ago
No, not at all. There is no concept of a component on the server side in GWT. For GWT server is like a second tier, similar as you would write in JavaScript. Though, GWT gives you few ways to communicate with server:

1. RPC, which is in a way similar to RMI. It supports polymorphism, so you can get an interface in response and GWT will create correct implementation. Java is required on server.

2. RequestFactory, which is more focused on data transfer than implementation. It also allows to transfer data model, which in server is not compatible with GWT. Sends only delta of changes when sending back to server. Also requires Java on server.

3. REST. It is not maybe advertised that mutch, but GWT can work with any REST endpoint. It has built in JSON (de)serialization with AutoBeans; or you could also use Overlay types. There also some third party libraries for REST. This time server can be anything, just to return JSON.

But if you really want to have sibling component on the server side, then there is Vaadin - a framework built on top of GWT which has server-side components which synchronize with client-side counterparts. But then, all handlers are on server, rather than client as with GWT.