Martin Desruisseaux ha scritto:
> Jody Garnett a écrit :
>> Andrea Aime wrote:
>>> Again, I don't know how many people will be affected
>>> by changes in the changes of the metadata module, so I may be
>>> overestimating the issue.
>>>   
>> People do use the metadata classes directly; and have to make use of 
>> constructors to do it - so this change *will* break some users. 
>> However the groups I know making use of these interfaces forked away 
>> from GeoTools in order to make a copy of these classes backed on to 
>> Hibernate.
> 
> In GeoTools code base, the main metadata user is the referencing module, 
> which instantiate metadata objects for "domain of validity", "accuracy", 
> "identifiers" and a few others.
> 
> Outside GeoTools, there is some codebase I'm involved with but we will 
> take care of it. I'm not aware of other extensive usage.
> 
> But Jody is right, we need a factory. I commited myself to write it. 
> However the drawback is that I do not expect a factory like the 
> referencing or geometry one, with explicit "createCitation(...)" and ton 
> of arguments, because we have ~100 metadata interfaces and ~400 
> attributes. A factory interface providing type-safe methods for all of 
> them would be a monster. I rather expect a single method with a 
> signature like this one:
> 
>     <T> T create(Class<T> type, Map<String,?> attributes);
> 
> i.e. attributes values are given in a map. They would be dispatched to 
> setter methods using reflections.

I personally would prefer a type safe monster that allows for auto
completion and compiler checks to a factory that makes me fight
to get an object built.

Is there any chance the factory can be built automatically using 
reflection over the existing implementations? Like, add all your objects
to the classpath, find a way to scan the contents of specific packages
(maybe assuming they are not jarred up so that you can scan the fs for
.class files), use reflection to determine the attribute names and 
types, and finally generate the code for the factory out of it?

Cheers
Andrea

-------------------------------------------------------------------------
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

Reply via email to