Javier has posted 48 posts at DZone. View Full User Profile

OpenXava 4.1: Rapid Development with Bean Validation support

02.16.2011
| 1897 views |
  • submit to reddit
OpenXava is a framework for rapid development of business applications using Java or Groovy. It is easy to learn and one can have an application up in no time. At the same time, OpenXava is extensible, customizable and the application code is structured in a very pure object oriented way, allowing you to develop arbitrarily complex applications.
The OpenXava approach for rapid development differs from those that use visual environments (like Visual Basic or Delphi) or scripting (like PHP). Instead, OpenXava uses a model-driven development approach, where the core of your application are Java classes that model your problem. This means you can stay productive while still maintaining a high level of encapsulation.

The new version of OpenXava, OpenXava 4.1, adds support for JSR-303, the Java standard for validation. Moreover, it contains some interesting features in the list and the collections user interface.

The support of Bean Validation standard (JSR-303), together with the already supported JPA 2.0 (JSR-317) and  Dependency Injection (JSR-330) standards, allows you to move your JBoss Seam or Spring application code (at least the entities) to OpenXava in order to obtain a Rich AJAX application from you already existing code in no time.

The best way to taste the new features of OpenXava 4.1 is downloading it and following the Quick Start guide.
Below you have some of the main new features present in OpenXava 4.1.

Bean Validation (JSR-303)

OpenXava has full support for the standard Java for Bean Validation JSR-303. You can define your own constraints for your entities as explained in Bean Validation specification or use the built-in constraints, and OpenXava will recognize them, showing the corresponding validation messages to the user. Therefore, if you write a class like the next one:
package org.openxava.test.model

import org.openxava.model.*;
import org.openxava.annotations.*;
import javax.persistence.*;
import javax.validation.constraints.*; // From JSR-303

@Entity
class Artist extends Identifiable {

@Column(length=40) @Required
String name

@Max(99l) // @Max is a build-in constraint of JSR-303
Integer age

}
when you try to add a new object OpenXava applies the validation:

More possibilities for the list and the collections

OpenXava 4.1 adds new possibilities for the user, such as order by several columns, or adding summations:


These are only some of the new features, you can view the full list in the changelog.

Download OpenXava 4.1 and try it
0
Published at DZone with permission of its author, Javier Paniza.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)