Jody Garnett wrote:
> I thought they were only doing this pattern to provide themselves
> choice between having it as a reference or inline?
It is to cause type information to be encoded inline in GML. But why
should we use an intermediate object in GeoAPI?
> <element name="location" type="gml:LocationPropertyType">
> <annotation>
> <documentation>Deprecated in GML 3.1.0</documentation>
> </annotation>
> </element>
OK, I picked a deprecated example. My bad.
> As for the actual LocationPropertyType it is a choice between several
> things as I mentioned above. An actual Geometry or a magic string or
> whatever.
So why should we not remove the intermediate GeoAPI object? It adds
nothing. It is a GML encoding artifact.
> Finally both of these are deprecated; what do they recommend to do
> now? Maybe they learned their lesson?
No, the Outer - InnerProperty - Inner pattern is used everywhere.
> In this case the separation of concerns was between the element name
> and the type; not sure I see the problem. In java we have a separation
> between a field name and a class type; same thing here.
This is not the same. It would be like having a StringProperty class to
encapsulate a String:
class StringProperty {
...
public String getString() ...
...
}
and using it *everywhere* you wanted to use a String. What does it add?
It is a pointless extra wrapping layer.
every o.getString would become:
o.getStringProperty().getString()
I am trying to draw a distinction between GeoAPI and GML. I do not know
any reason to follow the GML pattern in GeoAPI. In GeoAPI we have direct
access to type information, so we do not need to follow the GML pattern,
which exists to encode type information. It makes the bindings more
complicated than they need to be. Furthermore, it prevents us from
treating associations and attributes consistently, because association
references get smuggled as attributes on property types, while
attributes are inline.
--
Ben Caradoc-Davies <[email protected]>
Software Engineer, CSIRO Exploration and Mining
Australian Resources Research Centre
26 Dick Perry Ave, Kensington WA 6151, Australia
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel