[josm-dev] [PATCH] OsmPrimitive / PrimitiveData refactoring
Paul Hartmann
phaaurlt at googlemail.com
Thu May 26 22:48:54 BST 2011
Hi,
There are two structures
OsmPrimitive / Node / Way / Relation
and
PrimitiveData / NodeData / WayData / RelationData.
Both have much in common, however, the class trees are unrelated at the moment. In order to avoid code duplication when it really doesn't matter if you have an object from the 1st or from the 2nd category, I put common features to an interface and added an abstract base class [1,2]. The above classes can be replaced by the respective interface
IPrimitive / INode / IWay / IRelation
when only common functionality is needed. Commit [3] shows, how this would look in practice: In my use case, I'd like to upload PrimitiveData objects without converting them to OsmPrimitive first.
Haven't checked the history stuff, maybe this can be consolidated as well, somehow.
[1] https://github.com/bastik/josm/commit/a91ea53
[2] https://github.com/bastik/josm/commit/780d186
[3] https://github.com/bastik/josm/commit/7b1d245
Paul
More information about the josm-dev
mailing list