Which is better in GWT?

which is better in GWT interface, using the normal MVP with javacode, or UiBinder?? from performance, editing, simplicity aspects.


This is what Google says:

Besides being a more natural and concise way to build your UI than doing it through code, UiBinder can also make your app more efficient. Browsers are better at building DOM structures by cramming big strings of HTML into innerHTML attributes than by a bunch of API calls. UiBinder naturally takes advantage of this, and the result is that the most pleasant way to build your app is also the best way to build it.

So probably judging by the points you mentioned, UiBinder provides more advantages. However, I wouldn't do everything in UiBinder. Just start with it, and you'll find out, where a little bit of pure code might be a better (or the only) choice!

The direct answer to your question is : BOTH! :)

Simply build the MVP architecture then build each VIEW using the UiBinder. This is what I have been doing and it work perfectly. UiBinders can be attached to whatever class you want, as long as it has the same name as your class. (EX: YourView.java + YourView.ui.xml)

There is a tutorial in GWT doc that explain the UiBinder, although it's missing many important point.

I will soon be releasing a project with that architecture on Google code using the GPL. If you're interested, I can add the URL here when it's out so you can have a direct example of how they work together.

I also suggest you use ClientBundles for all your CSS and Images. If you want argument on the matter, there is plenty in GWT tutorial of ClientBundles. I've also integrated them perfectly with my MVP+UiBinder architecture and it work like a charm. The only problem here is that the ClientBindle tutorial was missing many important information so I had to play around a lot to make it work perfectly.

For each VIEW, I'd always use UiBinder. But for some simple Composite (homemade widget), I'd say it is sometime best to use direct javacode as Chris_l said.

Need Your Help

Delphi 2010 Calculated Column In DBGrid

delphi ado delphi-2010 dbgrid

I have a Delphi 2010 ADO program that has a DBGrid. Its dataset selects from an Access query. The query has a column defined as, CStr(Amount*UnitCount)+" "+Unit. The query works fine in Access. But...

Existing T4 database helpers for DB schema retrieval

database t4

Do you know any T4 template which would provide me with basic DB schema methods and properties (GetTables, GetColumns, MapSqlTypesToClr, etc.)?