"Bean Validation" specification (aka JSR-303) standardizes an annotation-based validation framework for Java
Flex doesn't provide by itself such framework. The standard way of processing validation is to use Validator subclasses and to bind each validator to each user input (see Validating data). This method is at least time consuming for the developer, source of inconsistancies between the client-side and the server-side validation processes, and source of redundancies in your MXML code.
GraniteDS introduces an ActionsScript3 implementation of the Bean Validation specification and provides code generation tools integration so that your Java constraint annotations are reproduced in your AS3 beans
GraniteDS validation framework provides a set of standard constraints
Constraint
Description
AssertFalse
The annotated element must be false
AssertTrue
The annotated element must be true
DecimalMax
The annotated element must be a number whose value must be lower or equal to the specified maximum
DecimalMin
The annotated element must be a number whose value must be greater or equal to the specified minimum
Digits
The annotated element must be a number whithin accepted range
Future
The annotated element must be a date in the future
Max
The annotated element must be a number whose value must be lower or equal to the specified maximum
Min
The annotated element must be a number whose value must be greater or equal to the specified minimum
NotNull
The annotated element must not be null
Null
The annotated element must be null
Past
The annotated element must be a date in the past
Pattern
The annotated String must match the supplied regular expression
Size
The annotated element size must be between the specified boundaries (included)
Constraint annotations must be placed on public properties, either public variables or public accessors
GraniteDS introduces an ActionsScript3 implementation of the Bean Validation specification and provides code generation
tools integration so that your Java constraint annotations are reproduced in your AS3 beans
JSR-303 (“Bean Validation”) ActionScript3 framework for form validation
validation framework is a specific adaptation of the JSR-303 (Bean Validation) specification to Flex: like its Java counterpart, it relies on validation annotations placed on bean properties and provides an engine API that lets you validate your forms without writing by hand a specific validator for each of your input fields
code generation tools provided by GraniteDS so that when you write your Java entity bean with validation annotations, they are automatically replicated in your ActionScript3 beans
problem with LCDS is mainly that it promotes a strict “client / server” architecture, with – roughly speaking – a heavy Flex client application connected to a server almost reduced to a database frontend
big majority of these organizations use BlazeDS, a free and open-source subset of LCDS
need more advanced mechanisms than just Remoting start looking for open-source libraries to enable deeper integrations with the Java business layer, and GraniteDS is for sure the most popular project
“Flex Data Services” (now renamed to “Live Cycle Data Services”)
All entities marked as [Managed] are considered as corresponding to Hibernate/JPA managed entities on the server
It is highly recommended to use JPA optimistic locking in a multi-tier environment (@Version annotation
In conclusion, the recommended approach to avoid any kind of subtle problems is to have a real uid property which will be persisted
in the database
but is not a primary key for efficiency concerns
Here all loaded collections of the Person object will be uninitialized so uperson contains only the minimum of data
to correctly merge your changes in the server persistence context
Tide uses the client data tracking (the same used for dirty checking, see below) to determine which parts of the graph
need to be sent.
Dirty Checking and Conflict Handling
Data Validation
Tide integrates with Hibernate Validator 3.x and the Bean Validation API (JSR 303) implementations, and propagate the server validation errors to the client
UI components