You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Jonathan Carlson <jo...@yahoo.com> on 2002/06/10 20:40:30 UTC

[Collections] Proxy* classes

I'd like to add my two cents on the these classes:
ProxyMap, ProxyListIterator, ProxyIterator.

The use of the term "Proxy" in these classes is very
confusing for those who are familiar with the grandaddy of
pattern definitions books, "Design Patterns" by the "gang
of four".  I would like to suggest that the term
"Decorator" would communicate much more succintly and
clearly the function these classes perform.

Here are their definitions:

Decorator - Attach additional responsibilities to an object
dynamically. Decorators provide a flexible alternative to
subclassing for extended functionality.
http://www-white.media.mit.edu/~tpminka/patterns/Decorator.html

Proxy - Provide a surrogate or placeholder for another
object which cannot be accessed by normal means. 
http://www-white.media.mit.edu/~tpminka/patterns/Proxy.html

At the very least, the javadoc should be updated to say
something like this: 

"Decorates a List with abstract pass-through
behavior.&nbsp;Subclasses should override methods to add
additional decoration behavior."

(see
http://java.sun.com/j2se/javadoc/writingdoccomments/index.html)

My 2 cents :-)  If I've misunderstood the real purpose of
these classes (I haven't looked at the code) then the
javadoc should probably be clarified.

Jonathan



=====
Jonathan Carlson
joncrlsn@users.sf.net
Minneapolis, Minnesota

__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>