Hacker News new | ask | show | jobs
by polskibus 4162 days ago
I've never used GWT, but it looks a lot like ASP.NET (all the button declarations in code, heavy page lifecycle in code, etc.). Can anyone with ASP.NET knowledge comment on that? ASP.NET has many problems, there are valid reasons why most developers are moving towards ASP.NET MVC so I wonder what is the place for GWT in modern web dev.
1 comments

First difference is that ASP.NET is running on the server side. GWT is fully compiled to JavaScript and runs in browser. The server doesn't even need to be Java, can be even plain web server without server side code. With GWT you typically develop one-page web applications.

As of doing everything in code - not necessary. As of now GWT has UiBinder - it is a kind of template or DOM + widgets, where you then bind code to it. But in upcoming 3.0 it will use web components standard (http://www.w3.org/TR/components-intro/)

Thanks for clarification. Does GWT assist in storing component state on the server?
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.