• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Declarative UIs

 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is the advantage of using a declarative style of UI building?

I am a UI developer and regularly build UIs using Swing, JME and GWT. I have noticed that declarative UIs are sort of favorite with Google. Android has it. So does GWT (GWT did start with swing style API but I suspect, with the UI Binder and the MVP, they are moving towards XML base) As a developer who prefers pure hand coding, I dont really like this. It smells too much of Drag & Drop style UI builders, which in my opinion, is bad news. In my experience, hands on coding facilitates extreme level of control as required.

On this background, one cannot help but wonder, what are the advantages of using declarative style of UIs.

 
author
Posts: 13
Android Google Web Toolkit Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi there Maneesh,

In Android XML based layouts are loaded through a mechanism that could be seen as similar to a java.util.ResourceBundle. The main difference is that in Android the resource loader takes far more than just language into account. Some of the additional parameters that the resource loader takes into account are: time of day, screen size, pixel density, and device orientation. The full list of these attributes is available in the Android Documentation.

For GWT I've found that the XML layout structure makes it easier to work with designers that think and work in HTML, while not sacrificing any of that GWT goodness. That said: I don't see the GWT UIBinder adding as much value to my work as the Android loading mechanism.

In neither of these platforms are you forced to work with the XML layout, but certainly with Android I strongly recommend it. Coding different screens in Java for all the possible device permutations would be a nightmare, take significantly longer, and would also require special handling of changes to the device configuration (language, orientation, etc.).

Regards,
Jason
 
Maneesh Godbole
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Jason
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic