dev@jsr311.java.net

Re: JSR311: Breadcrumbs

From: Stephan Koops <Stephan.Koops_at_web.de>
Date: Fri, 29 Feb 2008 20:27:45 +0100

Hello Marc,
> The proposal would give you {"foo"=>FooResource,
> "foo/bar/baz"=>BazResource}.
with this change I agree. It's a good idea.

I think it is better to start the keySet / entrySet iterator with the
resource class created by the last sub resource locator, not with the
root resource class. I think the case, that an app developer wants to
get the resource class created this resource class or the second is more
often than get the root resource class instance or the resource class
created directly by the root resource instance.

Perhaps it is possible to return the keys and the entries as List, to
have an direct access via keys.get(index), but I have no very good idea
to specify it.
One possibility is to define a Map sub interface which returns not Set,
but a new OrderedSet (extending Set, and is unmodifiable) or something
like this, which also implements get(index). But it's not a very good
solution, because it require two new sub interfaces. I think this should
be integrated in the java.util package; I think a lot of people could
need this behaviour.

The method should return an unmodifiable Map, IMO.

best regards
   Stephan