130 likes | 267 Views
Form Builder. Tom áš Č ern ý Michael J. Donahoo Eunjee Song Department of Computer Science Baylor University, Waco, TX. Content. Introduction Background Manual form generation Tool Example Related work Conclusion. Introduction. Java EE web applications JSF, Seam, Hibernate
E N D
Form Builder TomášČerný Michael J. Donahoo Eunjee Song Department of Computer Science Baylor University, Waco, TX
Content • Introduction • Background • Manual form generation • Tool • Example • Related work • Conclusion
Introduction Java EE web applications JSF, Seam, Hibernate • Entity beans determine view forms • Manual form development is error-prone and tedious • Developer consistency • Weak type safety in view • Properties propagation • Entity bean inconsistency with view form • Form auto-generation by our tool • Client-side validation
Background • Java Platform, Enterprise Edition (Java EE) • Presentation tier - JSF • Business tier – Session bean • Persistence tier – Entity bean • Java Server Faces (JSF) • Rich user interface on server side • Components • Facelets (XHTML) • Templating framework • Enterprise JavaBeans (EJB) • Distributed applications
Manual form generation • What we want to create? • read-only and editable form
Manual form development • What do I need to know? • Field - component mapping • Horizontal properties • field type ► component type • Integer ► inputNumber component • Vertical properties • field annotation ► component type • String ► @Password ► inputPassword • mapping condition • String ► length > 255 ► inputTextArea
Tool • Java Application • XML configuration • Mapping field ► component template • Template-based form generation • Developer can use his favorite view components • Component libraries – client-side validation
Example @Entity @Table(name = “person”) publicclassPerson { privateString name; @NotNull @Length(max=100) publicString getName() { returnname; } publicvoidsetName(String name) { this.name = name; }
Example <rb:inputTextid="$id" edit="#{editable}" value="#{$value}" label="$label" size="$size" maxlength="$maxlength" required="$required"/>
Example <rb:inputTextid="name" edit="#{editable}" value="#{bean.name}" label="Name:" size="30" maxlength="100" required="true"/>
Conclusion Contribution • New tool for JSF applications • New development style • Significant development time decrease • Client-side validation Future work • Use the idea in Model Driven Development • Extend tool for table generation • Extend tool for test generation • New client-side validation (lower X greater)