On 06/13/2009 08:40 PM, markww wrote:
> Hi,
>
> This is a general question about GWT and user interfaces. In my
> (limited) use with PHP, the server was responsible for generation of
> most of the 'UI'. Each script would emit some html which the client
> browsers download and render.
>
> If we wanted to write a project only using GWT for the presentation,
> this model changes. As I understand it, now the server will spend less
> time generating text via PHP scripts, because it would just be handing
> out the same static .js files - the .js files are the compiled .js
> app. Once it gets to the client browser, the javascript handles
> building out the entire UI (via all the Widget classes).
>
> If this is true, I wonder if anyone can comment on how it affects
> performance (this is a very general question I know). In a PHP-driven
> site, maybe for a logged-in user section I would have done something
> like this:
>
> echo "<div id='blah' etc etc/>
> <p>Some text</p>
> <p>Welcome back, " . $username . "!!!!</p>
> </div>";
>
> now with GWT, I would have set up a bunch of widget classes, then done
> a separate AJAX call and pull down a JSON representation of the user
> to populate my widget:
>
> public class MyProject implements EntryPoint
> {
> public void onModuleLoad()
> {
> VerticalPanel p1 = new VerticalPanel();
> final Label label = new Label("Loading...");
> p1.add(label);
> RootPanel.get().add(p1);
>
> asyncAjaxCall("http://mysite.com/getUserInfo.php") {
> public void onSuccess(Response response) {
> label.setText(JSONParse.parse(response));
> }
> }
> }
> }
>
> I'm not sure which approach is better for the web application I want
> to write. Preferably I'd like to stick totally with GWT for client-
> side, and use PHP via AJAX to get data from my database to populate
> the UI. But I'm not sure if all the widgets I want to create to make
> an appealing user interface will overburden users' browsers, and
> therefore am better off just using PHP to generate the pages for me.
>
> Thanks for any thoughts
>
Good question. However, there are other dimensions to GWT that aren't
considered in your question.
Have you seen this introduction to the Google Web Toolkit:
http://www.scribd.com/doc/44602/Google-Web-Toolkit
I think it may be relevant to answering your question in that it will
provoke an understanding of why to select GWT besides widgets and AJAX
support. If that's all you want, there are plenty of other (in some
cases better) JS widget/AJAX libraries.
As far as performance, there's really only one benchmark that matters:
your application and your user's expectations of its behavior. It may be
that you have to prototype a proof-of-concept before you can get a
legitimate answer.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---