Martin Desruisseaux a écrit : > Okay, I will do a factory. A basic one should be easy enough to make, but I > don't know how useful it will be (because setters are provided only in > implementation classes). I will try and we will see.
There is a simple proposal, but I don't know if it would fit your needs. I'm assuming that creating a type-safe factory (like CRSFactory) would be unpratical: too many classes (~100), too many attributes in those classes: providing methods expecting all possible attributes in arguments would result in very long and fragile method signature (fragile because new attributes are added or removed at any new ISO specification). The proposal is to provides this single method in some MetadataFactory class: T create(Class<T> type, Map<String,?> attributes); Where - type is the interface (not the implementation class) to instantiate (e.g. Citation.class, OnLineResources.class, etc.). - attributes is a map of (attribute name, attribute value). Example for Citation.class: attributes.put("title", "there is my title"); attributes.put("edition", new Date(...)); // etc. Would it be acceptable? Martin ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php _______________________________________________ Geotools-devel mailing list Geotools-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-devel