Le Mon, 26 Oct 2009 15:11:10 +0100,
Emmanuel Lecharny <[email protected]> a écrit :

> Julien Vermillard wrote:
> > Hi,
> >
> > I think about removing IoSessionAttributeMap if what we could expose
> > if just a Map. As far as I understand it IoSessionAttributeMap is
> > here for adding all the utility methods.
> >   
> The question is : would anyone want to extend the IoSession API by 
> adding (useless) methods ?
> 
> If you have a look at HttpSession API, it's damn limited :
> |java.lang.Object| || 
> <http://tomcat.apache.org/tomcat-5.5-doc/servletapi/javax/servlet/http/HttpSession.html#getAttribute%28java.lang.String%29>|*getAttribute
>  
> <http://tomcat.apache.org/tomcat-5.5-doc/servletapi/javax/servlet/http/HttpSession.html#getAttribute%28java.lang.String%29>*(java.lang.String
> name)| 
> 
> |||java.util.Enumeration | 
> <http://tomcat.apache.org/tomcat-5.5-doc/servletapi/javax/servlet/http/HttpSession.html#getAttributeNames%28%29>|*getAttributeNames
>  
> <http://tomcat.apache.org/tomcat-5.5-doc/servletapi/javax/servlet/http/HttpSession.html#getAttributeNames%28%29>*()|
>  
> 
> |*removeAttribute 
> <http://tomcat.apache.org/tomcat-5.5-doc/servletapi/javax/servlet/http/HttpSession.html#removeAttribute%28java.lang.String%29>*(java.lang.String
> name)| 
> 
> |*setAttribute 
> <http://tomcat.apache.org/tomcat-5.5-doc/servletapi/javax/servlet/http/HttpSession.html#setAttribute%28java.lang.String,%20java.lang.Object%29>*(java.lang.String
> name, java.lang.Object value)|
> 
> Nobody ever wanted one more method, and nobody ever wanted to know
> how it is handled by the server (as a Set, a Map, a List, whatever).
> 
> IMHO, this is what we should do : keep it dead simple. We don't have 
> have to expose a Map. Kill the IoSessionAttributeMap interface.
> 

That's the idea for me.

kill IoSessionAttributMap,
put a Synchronized HashMap in AbstractIoSession
and provide only : getAttribute, setAttribute, removeAttribute,
getAttributeKeys (could be renamed to getAttributeNames)

Attachment: signature.asc
Description: PGP signature

Reply via email to