[osmosis-dev] Tags class
Brett Henderson
brett at bretth.com
Thu Feb 5 04:12:56 GMT 2009
Jochen Topf wrote:
> I think conceptually its a bit cleaner to have a Tags class, because
> everything in it is pretty much self-contained and doesn't need to know
> about the Entity around it.
>
Yep, I'm fine with that. I was wondering how much I was going to have
to update through the rest of osmosis but if it extends Collection<Tag>
it should be easy.
> Having way.getTags().getIterator() and way.getTags().findByKey("x")
> seems a bit cleaner to me than way.getTagsIterator() and
> way.findTagByKey("x") etc. Also if it is done as a child class of List
> or Container or something we'll get some things for free, like the
> Iterator stuff.
>
Yep, sounds good.
> In a way we already have a class for Tags, but its Collection<Tag>
> instead of something that we can usefully extent to have more
> functionality.
>
> That all beeing said, I don't care much either way. I also tend to
> think not very Java-ish, beeing used to other OO languages, so maybe I
> am proposing something unusual for Java.
>
It sounds very java'ish to me :-)
What do you think Marcus? It would be a good place to add utility
methods such as "Map<String, String> buildMap()" if you want them.
The next question will be modification methods. Either these changes
will have to be added to the EntityBuilder class as well, or the whole
immutable thing I've got going will have to be scrapped.
More information about the osmosis-dev
mailing list