From: Jody G. <jga...@re...> - 2006-06-09 21:10:57
|
Cory Horner wrote: > Hey Jody, Justin, > > I had a peek at FM this morning... took a few stabs at fixing it, but I > have a question which i'll phrase in the form of a class: > > org.opengis.feature.AttributeFactory? > Now called FeatureFactory. Since this is a feature model, and since we now have more then attributes I decided not to play around anymore. Code is committed, although I had to battle a few conflicts, my own fault for keeping the code so long - thanks for releasing a new geoapi jar BTW. So far in talking to Justin I have found a few ground rules that when I screw up has me fail a code review. These are hard to capature .. but I gotta try anyways. #1 Builder vs Factory: - XFactory does what it does *exactly* with no logic - XBuilder maintains state and can do the logic you wanted to put in the factory #2 DataStore and its Factories: - AbstractDataStore is focused on "simple" features - AbstractDataStore "owns" types and thus *needs* a SimpleTypeFactory in order to create them - FeatureSource "owns" data and thus needs a SimpleFeatureFactory in order to create data #3 Iterators and FeatureReaders/FeatureWriters - FeatureReader and FeatureWriter are no longer a focus of interaction - Iterators "create" content, each pass through the data will need *its own* FeatureBuilder All of Data basically fails Guideline #3 and will need to be fixed. You can see this failure when ever you see a FeatureBuilder (or any Builder) passed around as a parameter between classes, or stored for reuse). This is hard to test as the problem will only occur when the DataStore is being used by two threads (or if a FeatureCollection is being used by two threads). Let me capture that as a guidelines. #4 Builders should only ever be a local variable. Once again sorry for being slow on this kind of writing, Jody |