Andrea Aime ha scritto: > Jody Garnett ha scritto: >> Andrea Aime wrote: >>>> Perfect! This is exactly the kind of thing I was hoping for as we set >>>> up FeatureList. >>>> >>>> FeatureCollection.sort( SortBy ).iterator() should give you a "sorted >>>> writer". The iterator should let you work over top of a sorted result >>>> set :-) >>> I have a preference for working against FeatureReader and FeatureWriter >>> because they're simpler and more predictable imho, so I would really >>> like a public DataStore call that sounds like: >> And I am trying to kill these things as a mistake :-( That is they are >> too low level, useful for implementing, but not so much to work against >> (they throw too many exceptions and do not follow the collections api). > > I have the exactly opposite impression? FeatureCollection is confusing > and breaks normal way of doing things, FeatureReader and Writer and > simple and straightforward. Having to throw runtime exceptions because > you had an internal probelm in an iterator is what I call error prone > and hard to deal with. You expect it to be a normal collection, then > it starts throwing exception here and there.
To rephase this, I think FeatureReader and Writer are just what they are, simple, no suprises. FeatureCollection tries to add a level of abstraction, but that abstraction leaks in way to many places: * runtime exceptions during iteration (no normal collectin does that unless you are making a programming error afaik) and don't clean up after themselves * you have to close iterators so you break the usual contracts * you have two funny ways to iterate, iterator and featureIterator * you pay the price of a writable thing and this is not stated anywhere... getView strikes me as something that has to deal with projections and the like, just like a sql view, I would not look for getView just to gather the whole feature type. Hibernate collections are a different kind of beast, they are kept in memory, they don't hit the db as you modify them, and no, you don't have to close or purge them, because they are fully loaded in memory, so they do really behave just like normal collections, they only difference is that they can be lazy loaded and that it's not advisable to replace them with a standard collection, better keep the ones that Hibernate gives you and clear them if you really need to change their contents fully. If you want stuff as paged access, you have to make a query for it and deal with a paged access API. Cheers Andrea ------------------------------------------------------------------------- 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
