The Artima Developer Community
Sponsored Link

Java Buzz Forum
Spring-Rich: GUI Builders

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Scott Delap

Posts: 1154
Nickname: scottdelap
Registered: Sep, 2004

Client / Server application developer.
Spring-Rich: GUI Builders Posted: Nov 8, 2004 6:08 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Scott Delap.
Original Post: Spring-Rich: GUI Builders
Feed Title: ClientJava.com
Feed URL: http://www.clientjava.com/archives/wireless_mobile.rdf
Feed Description: Client/Desktop Related Java Development
Latest Java Buzz Posts
Latest Java Buzz Posts by Scott Delap
Latest Posts From ClientJava.com

Advertisement

There is also a thread going on over on the Spring-Rich forums in regards to GUI builders (notably drag-n-drop form designers), and how Spring-Rich approaches the issue. The core message is that while GUI generators may make things easier to start with, and can be a great for quick and dirty prototyping, code maintainability can quickly become an issue. Frameworks, on the other hand, strive to simplify 1e00 —capturing common concerns that can be reused and easily coded by hand. Which is easier---managing 50 forms spit out independently by a GUI generator, or leveraging a form builder API to create decipherable code that can be packaged and reused?

Spring Rich’s form builder API is a layered API, integrated with its data binding framework, allowing for the construction of forms whose fields are automatically bound to backing domain objects.

Here is an example:


    TableFormBuilder builder = new TableFormBuilder(customerFormModel);

    builder.addSeparator("separator.contactDetails");
    builder.row();
    builder.add("name");
    builder.row();
    builder.add("orgPosition");
    builder.row();
    builder.add("orgName");
    builder.row();
    builder.addSeparator("separator.addressDetails");
    builder.row();
    builder.add("address1");
    builder.row();
    builder.add("address2");
    builder.row();
    builder.add("city");
    builder.row();
    builder.add("state");
    builder.add("postcode", "colSpec=2cm");
    builder.row();
    builder.add("country");

    return builder.getForm();


This builder produces a form for editing a “Customer” object. The fields "name", "title, "company", etc are properties on the backing Custom domain object, in this case, a standard JavaBean (POJO.) The builder leverages a FormComponentFactory that uses metadata to drive default control selection—for example, auto-selecting a text field for you for the “firstName” and “lastName” field but a CombBox for the “state” field. Each field’s label is automatically added for you, pulled from an i18n message source.

In many ways the GUI Builder/Designer debate is very similar to good OO programming principles.

Spring Rich: GUI Builders

Read: Spring-Rich: GUI Builders

Topic: RFC 3930 Previous Topic   Next Topic Topic: using jaxp 1.3 in j2se 1.4

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use