Hi, I'm working on support for referrers and I run into a problem which I'm not sure how to fix. Currently JOSM quite often makes copies of primitive (using for example cloneFrom or special constructors). It's not obvious whether the copy is added to the dataset or is kept in case we need to get back to old version of primitive (for example Command.cloneMap). That's a bit problem because I don't want to have such copy in referrers list, I want only primitives that are really used in an dataset.
To workaround this issues I'm thinking about introducing new classes - PrimitivePrototype, NodePrototype, WayPrototype and RelationPrototype. These classes will hold informations for one primitive, but it will not be possible to add these objects to the dataset. That will allow to clearly distinguish what's real primitive and whats just an backup copy for for example Command.cloneMap or Main.pasteBuffer. Obviously it will be possible to construct new primitive based on prototype. Method cloneFrom() and constructoctors like Node(Node n) will be removed to make sure everybody is using new system. This will also fix another issue - for some features (most notably reliable events when primitive is modified) I need for every primitive to be part of exactly one dataset. This can be forced by making all primitive constructors protected and allowing to create new primitives only using methods like Dateset.addNode(node parameters..) or Dataset.addNode(NodePrototype). What do you think about that? Can you think of any problems this might bring us? -- Jiri _______________________________________________ josm-dev mailing list josm-dev@openstreetmap.org http://lists.openstreetmap.org/listinfo/josm-dev