Hi,

I could agree with you, they are likely not to be killer-points for a small 
team, but if 
you start having a good number of people working on the same projects then 
these 
may became critical points.

Another aspect that come up in my mind is that you can have different 
XXXView.ui.xml 
while keeping the same XXXView.java... which is nice if you need to try out 
different 
layout. Again, not a strong point, but if you start summing them up you can see 
that it 
can really be handy to have a declarative UI. 

Finally, after you have mentioned it, I do believe that your code may actually 
be slightly better 
optimized (depending on how you write your java code). This is a guess, I 
haven't checked. 
Anyhow, even if it is, I don't think you could notice the difference. So it 
doesn't  really add any 
value on picking UIBinder over pure Java code.

It's a matter of taste and need, not a necessity.


-- Mirco

On Jan 27, 2010, at 11:42 PM, Djay wrote:

> Hi,
> 
> After reading some info on that and thanks also to your answer I'm
> still not convince.
> 
> I've spent some time to study the showcase delivered in the 2.0 SDK
> and I don't see any usage of the UIBinder.
> 
> I'm really wondering what could be the motivations to use such
> architecture (except the 2 reasons you mentioned).
> 
> Thanks,
> Gerald
> 
> On Jan 26, 7:56 pm, Mirco <[email protected]> wrote:
>> Hi Gerald,
>> 
>> declarative UI have some good advantages. The ones that first pop up in my 
>> mind are:
>> 
>> - Your Web designers (which are usually not very used to Java fanciness) can 
>> be more confident while
>>    retouching the layout of your application. Which also decrease the 
>> chances that several people (devs
>>    and designers) touch the same file, with the risk of nasty conflicts to 
>> resolve.
>> 
>> - A second advantage goes back to the verbosity of Java, which has not been 
>> designed to be a GUI language
>>   (rather it is a general-purpose language). Cf this example from the GWT 
>> Tutorial.
>>    http://code.google.com/webtoolkit/doc/latest/DevGuideUiBinder.html
>> 
>> --------------------------------------------------------------------------- 
>> --------------------------------------------------------------------------- 
>> ------------------------------------------
>> public class MyFoo extends Composite {
>>   Button button = new Button();
>> 
>>   public MyFoo() {
>>     button.addClickHandler(new ClickHandler() {
>>       public void onClick(ClickEvent event) {
>>         handleClick();
>>       }
>>     });
>>     initWidget(button);
>>   }
>> 
>>   void handleClick() {
>>     Window.alert("Hello, AJAX");
>>   }}
>> 
>> In a UiBinder owner class, you can use the @UiHandler annotation to have all 
>> of that anonymous class nonsense written for you.
>> 
>> public class MyFoo extends Composite {
>>   @UiField Button button;
>> 
>>   public MyFoo() {
>>     initWidget(button);
>>   }
>> 
>>   @UiHandler("button")
>>   void handleClick(ClickEvent e) {
>>     Window.alert("Hello, AJAX");
>>   }}
>> 
>> --------------------------------------------------------------------------- 
>> --------------------------------------------------------------------------- 
>> ------------------------------------------
>> 
>> Hope this helps.
>> 
>> Cheers,
>>   Mirco
>> 
>> On Jan 26, 2010, at 7:04 PM, Djay wrote:
>> 
>> 
>> 
>>> Hello,
>> 
>>> I've started using gwt for a couple of weeks and still face a question
>>> on which I couldn't find any good answer.
>>> What is the added value of the UIBinder in gwt 2.0?
>> 
>>> For example, in my class, I can do:
>>> VerticalPanel vertPanel = new VerticalPanel();
>>> vertPanel.setSize(....); and so on
>> 
>>> or have a ui.xml file linked with my class.
>> 
>>> Why would have to choose the ui.xml rathen than only java code?
>> 
>>> Thanks,
>>> Gerald
>> 
>>> --
>>> 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 
>>> athttp://groups.google.com/group/google-web-toolkit?hl=en.
> 
> -- 
> 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.
> 

-- 
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.

Reply via email to