[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
Session attributes
CXXSP currently sets and retrieves session attributes by
value. I suggest that we set them by pointer, and define
life-cycle through documentation instead.
This
1. allows us to return NULL pointer in case attribute is not set,
thus preserving J2EE semantics
2. avoids making extra copies.
3. Allows us to fully abstract HttpSession and HttpSessionImpl, and so
make interface lot cleaner.
Now, the question of lifecycle.
Simplest solution: Objects in session live as long as session lives, or
untill
unset. Problem with this approach is that some object might be shared
between
sessions.
Second solution: Only allow reference-counted objects as session attributes.
Third solution: implement session listeners, and let programmer deal with
object lifecycle himself. Perhaps provide few utility classes to help
with that.
Comments?
--
Ilya A. Volynets-Evenbakh
Total Knowledge. CTO
http://www.total-knowledge.com