Andrea, I bumped against the ReTypeFeatureReader and FeatureType equality recently. I don't think my issues were quite as general as yours are, but here's what I came up with:
http://jira.codehaus.org/browse/GEOT-1080 and http://jira.codehaus.org/browse/GEOT-1081 Here's the nabble thread: http://www.nabble.com/ReTypeFeatureReader-use-tf2861074.html#a7994674 Also see my take on your questions inline: > First thing is, why are there two ways to compare FeatureTypes for > equality? > The first one is FeatureType.equals(xxx), the second one is > DataUtilities.compare(ft1, ft2). > Some places use the first, others the second, maybe in the same > algorithm (bad idea...). Yeah, no good if they do the same thing. > Second, why DefaultAttributeType.equals(...) does not take into > account the restriction when evaluating equality? Equality between AttributeTypes seems to be only partially implemented. Probably just to support some specific functionality. As seen in my JIRA issue above, I found a case where two GeometricAttributeTypes with different CRS's were being considered equal. Probably noone had run into the issue before. > > Finally, the bug. If I invoke getFeatureReader(FeatureType > requestedType, Filter filter, Transaction t) on a JDBC data store > and requestedType is a subset of the datastore's schema, I'm > guaranteed to get an exception from the ReTypeFeatureReader, > since the method builds a query that already extracts the > requested attributes but... there is a but in my opinion. > > What if the requested type had different restrictions on attributes? > Would it be ok to return a feature reader sporting a feature type > that's different (restrictions wise) from the one requested? > Depending on the application, the answer may well be no, because > the coder expects restrictions to operate on the returned features > as requested, no? See the other JIRA issue above. I think "ReType" is a bad name for the "ReTypeFeatureReader". Maybe "SubsetFeatureReader" or something. It's not really re-typing features, it's just returning a subset of their (flat) attributes. I *think*! --saul ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Geotools-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geotools-devel
