Data Conversion Life Cycle

The CDEJ infrastructure is responsible for the retrieval of data from the application server, the display of this data, the processing of user input, and the submission of data back to the application server. This process has a well-defined life cycle. Operations at each stage in the life cycle are performed in a domain-specific manner.

Not all data goes through each stage in the life cycle. Some data is displayed but not modified or resubmitted by the user (read-only); some data is created by the user and submitted without any initial value being retrieved from the application server (write-only); and some data is retrieved, modified by the user, and then resubmitted to the application server (read-write).

In the context of the value of a single property, the life cycle for reading the value is as follows:

  1. The value is fetched from the application server by invoking a business operation.
  2. If the value is one of a list of values for the same property, the related values are sorted using the compare operation and the resulting sort order is recorded.
  3. The value is formatted to a string representation by the format operation and is stored for later display.
  4. When the page is displayed, the value is retrieved and inserted into the XHTML stream.

The life cycle for writing a value is as follows:

  1. A string representation of the value is entered on a form by the user and the value submitted.
  2. The domain definition options for whitespace compression and trimming and for upper-case translation are applied to the string value by the pre-parse operation. The value remains in string form.
  3. If the business operation has declared the value to be mandatory, the value is checked to ensure that it is not empty or null. An error will be reported if this check fails.
  4. The value is parsed from its string representation by the parse operation and the resulting native Java object replaces the string value.
  5. The domain definition options for the size range, value range, and pattern match are applied by the pre-validate operation is applicable. The value is not modified by this operation. If a validation fails, an error will be reported.
  6. The value is validated by the validate operation to apply any arbitrary validation rules. Again, the value is not modified by this operation and validation failures are reported.
  7. The parsed and validated value is sent to the application server.

For a value that is treated as read-write, the life cycle is simply the combination of the read-only life cycle followed by the write-only life cycle.