17 décembre 2008

beans binding dans gwt

La JSR 295 a été crée pour définir un mécanisme de binding en Java. L'idée simple et supportée par de nombreux langages est que deux attributs de deux beans soit "liés", ce qui permet par exemple à un widget graphique de toujours rester synchronisé avec l'objet modèle qu'il affiche, sans devoir écrire du code de mise à jour fastidieux et répétitif.

beansbinding est l'implémentation associée à cette spec et est utilisé dans NetBeans, ce qui prouve une bonne maturité de la techno. Seulement le projet semble "dormant", et la JSR associée n'a pas bougé depuis 2006. Pourtant le mot clé "bind" utilisé par JavaFX montre bien l'importance de ce concept pour les IHM

gwt-beans-binding est un portage de la JSR 295 (ou plutôt de ses concepts puisqu'elle n'est ni aboutie, ni publique) pour GWT. La mise en oeuvre est très simple. Pour lier deux textBox par exemple, il suffit de déclarer :

Binding.createAutoBinding( READ_WRITE,
    textBox, BeanProperty.create( "text" ),
    model, BeanProperty.create( "name" ) );

L'équivalent codé "à la main" nécessite de définit de nombreux PropertyChangeListeners (NB: quand seront-ils supportés en standard par GWT ?).

Pourquoi se focaliser sur ce projet, encore en version 0.2, alors que d'autres options comme Gwittir offrent des solutions comparables ? 
  • D'une part, parce que quelque soit l'évolution de cette JSR, elle sera toujours considérée si un nouveau groupe s'attaque à ce problème de data-binding en Java. 
  • D'autre part, parce qu'elle propose une API simple et focalisée sur cette unique tâche. 
  • Enfin, parceque le développeur de cette petite librairie a l'air très motivé !
Pour voir gwt-beans-binding à l'oeuvre : démo

6 commentaires:

Unknown a dit…

batterie iphone 7 repaired four ipad for me today in two hours. Did a great job on all of them and charged a great price, especially for me not having to travel anywhere and sit around waiting on the repair. He traveled all the way to me and fixed everything on site. Plus his work comes with a warranty…

BradCovey a dit…

The Assignment Writing Help In Nottingham is quite successful in writing content on such complex topics with new world research

jamesstone a dit…

Programming Assignment Help London from expert writers. Our team is extremely knowledgeable and skilled, and we can provide you authentic assignment writing services on schedule. Get writing help for all subjects that is quick, original, and flawless with a 100% guarantee.

johnathanwell a dit…

When discussing "beans binding dans gwt," let's focus on the topic of binding mechanisms and their application within GWT rather than introducing unrelated services like write my assignment cheap. Let's share insights, tips, and experiences related to beans binding in GWT and how it enhances the development process. Engaging in technical discussions can contribute to a better understanding of the topic and foster collaboration among developers.

Assignment Help a dit…

For Nottingham Assignment Writing Services you can contact professionals who can deliver the best assistance at affordable prices.

HarrySmith a dit…

When I was overwhelmed with assignments and running out of time, I discovered the "Pay Someone to Do My Assignment UK" service. It's been a game-changer for me. The team here is incredibly professional and always delivers on time. They have a knack for understanding your exact requirements and tailoring assignments accordingly. Plus, their customer support is excellent. I no longer stress over assignments; I turn to them, and it's sorted. Highly recommended!