Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Realistically, I think this is going to be "horses for courses": each third party library (viewer or persistence) will have its own way of teaching it about the value type. 

Proposal: Use VSP for simple value types (single fields)

But what we might be able to do is define some common semantics in an updated version of the VSP interface, and then have an Isis-provided implementation of the appropriate SPI that can leverage this additional metadata.

...

As and when we integrate other viewers (eg Vaadin) or persistence stores (eg EclipseLink/Hibernate), then they will undoubtedly have their own SPIs similarly.  So again, it should be SomeSpiThatUsesValueSemanticsProvider.

Proposal: don't bother for Value types with multiple fields

The above general purpose idea will suffice for simple value types, basically wrappers around a single string or number, but something more sophisticated will be required for values that constitute multiple fields, such as an Interval (from, to) or a Coordinate (x,y) or an ImaginaryNumber (real, complex).

...

For DN, I see that SingleFieldMultiMapping inherits from JavaTypeMapping, so I hope that a value could be stored into separate columns, but again some more metadata will be required.

My suspicion is that this will become really difficult to accomplish in a fully generic way.  Therefore, for more complex value types we should simply structure the extensions module to have the appropriate submodules for those integrations that exist.

In other words, if I look at the valuetypes/coordinate directory, for example, it would look something like:

valuetypes/coordinate/

    applib/     - defines the value type itself

    wicket/     - module to link to if using the value type in Wicket

    restful/    - module to link to if using the value type in any actions or properties of domain objects exposed via the RO viewer

    vaadin/   - module to link to if using the value type in Vaadin

    datanucleus/   - if using JDO/DN

    hibernate/   - if using JPA/hibernate

    schema/   - if wanting to use the value type in schema  (still not sure about this one, and that ValueType enum)