2009/4/3 Niclas Hedhman <[email protected]>

> On Fri, Apr 3, 2009 at 10:46 AM, Stuart McCulloch <[email protected]>
> wrote:
>
> >    extends AbstractAssociation, Iterable<T>
>
> Well, IFF iterator().remove() actually works on the underlying set/list.
>

the iterator contract says "remove" can throw UnsupportedOperationException
(as indeed many implementations actually do) because it's an optional method


> > also, the wrapper methods should really be called "asList", "asSet", etc.
> > because they return views onto the original object (see "Arrays.asList")
> > rather than copying the contents, while "to..." usually suggests copying
>
> Again, asXyz() only if the intent that calling the Collection's
> modifiers will change the underlying association, which *I* think is
> not feasible.
>

except that Rickard was talking about wrappers - if these methods provide a
wrapper that delegates through to the original object (such as an immutable
view) then it should be "asXYZ"

if they return mutable _copies_ then "toXYZ" would be more appropriate


> IMHO, I think the semantics should be a copy from a managed resource
> to a mutilatable JDK collection.
>
>
> Cheers
> --
> Niclas Hedhman, Software Developer
> http://www.qi4j.org - New Energy for Java
>
> I  live here; http://tinyurl.com/2qq9er
> I  work here; http://tinyurl.com/2ymelc
> I relax here; http://tinyurl.com/2cgsug
>
> _______________________________________________
> qi4j-dev mailing list
> [email protected]
> http://lists.ops4j.org/mailman/listinfo/qi4j-dev
>



-- 
Cheers, Stuart
_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev

Reply via email to