[josm-dev] jttt and private class members

Karl Guggisberg karl.guggisberg at guggis.ch
Tue Jul 28 19:24:29 BST 2009


I saw it too and I hope it's going in the direction of

First 
** Encapsulation
- getting rid of most if not all public field in Node, Way, Relation, and
DataSet 
- providing a richer API for compound primitives like ways and relations,
i.e.
    Relation::getReferringPrimitives() -> Set<OsmPrimtive>
    Way::isConnectedTo(Way other) -> boolean (or an enumeration
"undirected", "headToTail", "headTohead", etc.)
    Relation::getMemberReferringTo(OsmPrimitive primitive) -> RelationMember
    Relation::refersTo(OsmPrimtive primitive) -> boolean
    etc. etc. 
- providing a cleaner state model for OsmPrimitives (including unmodified,
incomplete, modified, deleted, visible) 
- possibly getting rid of the "selected" flag in primitives and adding
selection management to 
  DataSet, including emitting selection change events 
  (no more DataSet.fireSelectionChanged(...) after every update of the
selection)

Then 
** Efficiency
- possibly optimizing the then encapsulated datastructures of Dataset, i.e.
in order to optimize backreference lookup,
  as it is already probosed in the backreference visitor. Code for deleting
primitives, for "purging" primitives, and
  for parsing datasets would benefit from such an improvement too
- perhaps we can avoid to copy around large sets of primitives as the
allXYZ-Methods on DataSet do it today 

Additionally: a general cleanup of the code in the core data classes
wouldn't be no harm either

-- Karl   
  

-----Ursprüngliche Nachricht-----
Von: josm-dev-bounces at openstreetmap.org
[mailto:josm-dev-bounces at openstreetmap.org] Im Auftrag von Dave Hansen
Gesendet: Dienstag, 28. Juli 2009 19:21
An: josm-dev
Betreff: [josm-dev] jttt and private class members

I've seen some SVN commits from jttt doing some refactoring of the
Way.nodes.  First of all, very cool stuff.  I'd like to use this to make
some of my ReverseLookup code and a bunch of the validator tests faster.

What's the end goal of all of the churn, though?

-- Dave


_______________________________________________
josm-dev mailing list
josm-dev at openstreetmap.org
http://lists.openstreetmap.org/listinfo/josm-dev





More information about the josm-dev mailing list