After running into some pain with SessionMap on a project a while ago, I
have been looking into trying to get it into shape.

I have been focussing on the 1.x codebase, because it is what I get the most
benefit.  I'm looking to get some feedback on some of the changes I am
looking at before cutting the code.

There are three things that I can see that are worth looking at:

1) put violates the map contract
    -- put should return the value of the previous key.
(see WW-428 for fix)

2) Serialization on the Session -- having a map that does serialization
seems wrong when there is Collections.getSerializedMap(Map map, Object
mutex)

3) Session.clear() invalidates the session (WW-424).
I can understand the motivation for this, but it too breaks normal Map
behaviour.

I can see a number of possible improvements to 3
    -- if the map took in a request in the constructor it could use
getSession where appropriate
    -- Clear could removeAttributes instead of invalidating the session.
    -- The Exceptions could be caught and handled cleaner.

I would see that the nicest solution would be some variation of the first
suggestion.  This would keep the invalidation behaviour as it stands, and
make the map work in cleaner way.

Sergiy has also raised WW-413 which talks about a difference between
SessionMap and HashMap.  I notice that Pat has entered fix versions for
1.4.1 and 2 on this, but I don't actually see the fix for this. (Not that
it's really a big one).




---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.544 / Virus Database: 338 - Release Date: 02/12/2003



-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork

Reply via email to