Le 16/10/15 00:43, Nick Burch a écrit :
> Our current new-ish retrofitted model with properties (which offer
> both a simple string and richer typed values) covers most of those,
> but is struggling with the complex formats case.
>
> All the alternatives, including my own preferred (complexity on the
> key not value) have downsides and have issues on at least one of the
> above!
>
> I think we're all very keen to find out how other projects have
> tackled the same problem space, and how they've squared our circle...!
We tried to put tree structure in keys (rather than values) in another
project, but I abandoned that path because of its complexity. Since lot
of ISO 19115 properties can contains an arbitrary amount of values, we
had to define some selectors (e.g. "identificationInfo[1]/citation"
where "[1]" means "first element of the collection"). Then we have more
complex cases like "take the first date where date.type ==
DateType.CREATION" for fetching the creation date. We could use XPath,
but this is not very simple and can not cover all the needs.
For now, I did not yet found a good alternative to simple keys and
values as Plain Old Java Object. For those who need a more dynamic
approach, we provide views of each object as java.util.Map (using
reflection).
Martin