[osmosis-dev] Tags class

Jochen Topf jochen at remote.org
Thu Feb 5 12:41:01 GMT 2009


On Thu, Feb 05, 2009 at 12:43:40PM +0100, Marcus Wolschon wrote:
> On Thu, 5 Feb 2009 11:56:26 +0100, Jochen Topf <jochen at remote.org> wrote:
> > Why do we have two implementations for Tags, one is modifiable and one
> > not? If we do have that we should bring those together, shouldn't we?
> > Isn't the unmodifiable thing only to make things easier for
> multithreading.
> > I haven't looked at the details, but I could imagine something like
> > class Node that has no setter methods and child class ModifiableNode that
> > has setter methods.
> 
> The ModifiableNode is not to return a non-modifiable Tag and
> the Node is not to return a modifyable tag-list. Same for Way
> and Relation.

Then the getTags() method on class Node returns a non-modifiable Tags
object. That could be a simple cast. The method is overwritten in class
ModifiableNode to return the modifiable internal Tags.

> Brett wanted the immutable versions but added the -Builder-classes
> to ease the construction of entities in complex cases.

I don't see the need for the Builder-classes, but thats a different
issue anyway.

Jochen
-- 
Jochen Topf  jochen at remote.org  http://www.remote.org/jochen/  +49-721-388298





More information about the osmosis-dev mailing list