This week's book giveaway is in the Java in General forum.
We're giving away four copies of Event Streams in Action and have Alexander Dean & Valentin Crettaz on-line!
See this thread for details.
Win a copy of Event Streams in Action this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

GWT ... Platform and browser compliance?

 
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I've been looking at web development tools such as Flex and as of recent, GWT.
So far I'm relatively impressed by the Flex3 model. It makes sense to me that using a controlled environment within the context of the browser can potentially waylay the issues that often times becomes the majority of time spent when debugging browser based client side UI code. While using JavaScript is an option, it's been my experience that you are at the whim of the Browser, its version, and sometimes the OS at how well the UI will conform to the JS code and necessitates testing and modifying to a wide variety of configurations. And in many cases, the removal of some of the more interesting wigets (or conditionally working around them) is necessary.

This is why the idea of GWT doesn't sound like a good direction to me. I've seen references that claim that GWT will compile the javascript code in a manner to achieve browser rendering neutrality, but how? I would think the same issues of writing native javascript based pages would apply under GWT as well? I like the idea of being able to code my UIs in the same language that I do the majority of my coding (Java) but maybe I'm missing something fundamental here. How can GWT buffer the blow in this respect?

thanks,
Karl
 
Marshal
Posts: 67273
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The same way that JavaScript libraries such as jQuery do it: provide a common API that hides the browser differences.
 
Karl Krasnowsky
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Bear Bibeault wrote:The same way that JavaScript libraries such as jQuery do it: provide a common API that hides the browser differences.


Bear,
So is this accomplished by routing through a different runtime library specific to the browser or simply adding the conditional scripting scratch to work around differences when compiled?
From my understanding of how GWT works, it takes the GWT Java code and "compiles" it into the JS equivalent page code. Or is there more to it?
 
Bear Bibeault
Marshal
Posts: 67273
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The generated JavaScript will take into account any browser differences, just like jQuery/Dojo/Prototype code does, for the supported browsers. It's not rocket science -- it's a well-known and well-defined problem.
 
Karl Krasnowsky
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Bear Bibeault wrote:it's a well-known and well-defined problem.


Maybe so, but wouldn't it be a better model to encapsulate such differences through the use of a runtime library (as does Flex) in the case that either browser related bugs arose and/or new functionality was added? In GWT and like models it would seem that a regeneration of JS against an upgraded sdk would be necessary and regression tests and other safeguards to insure reliable code. I'm not a huge Adobe fan by any means, but their approach makes more sense to me.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!