Sunburned Surveyor wrote:
> I'm just curious why the PropertyDescriptor and PropertyType
> interfaces were made separate. How are they really different?
Can I explain by analogy?
In the following Java class:
class HelloWorld {
String name;
}
How is the field "name" and the class String different?
To adjust for Feature Model:
- PropertyTypes are similar to Class (ie like HelloWorld and String above)
- fields are similar to property descriptors (ie like *name* above)
A FeatureType is an example of a PropertyType in which:
- there is interesting internal content (ie it is has properties inside it)
- it can be drawn on a map (ie one of the properties is spatial in
nature; ie holds a Geometry)
Does that help?
Jody
> Will there be any issues if I implement both interfaces with a single class
> providing information about a DataObject attribute?
>
The practice would be similar to using an "anonymous" class in Java; it
will do the work but you miss out on chances of core reuse ...
Returning to our Java example it would be similar to the following code:
class HelloWorld {
MyString name;
class MyString{
char[] array;
}
}
You can represent the same data structure this way; but any code that
knows how to work with Strings will not have a clue what you are up to.
The "official" PropertyType for String is recognized and we know how to
parse / encode it for against "xs:string" when working with GML; when
you do your own thing you have more work to do.
The javadocs for PropertyDescriptor use this example of "xs:string"
> Does GeoTools provide default implementations of these two interfaces?
>
Yes, your code browser will help you find them. I generally use a
Factory to create these things ...
Cheers,
Jody
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel