Howard M. Lewis Ship
2003-01-10 02:14:06 UTC
I would like to discuss the global property added to IEngine.
I would like to see the solution fleshed out a little bit.
What I see is that, if there's a particularily named object in the servlet context, it is accessible from the IEngine. I have to assume the intent was to override ApplicationServlet.init() to provide Global. This is a bit different than how many other similar constructs, such as Visit, are implemented.
I would like to see:
1) An overridable method on AbstractEngine to create the Global.
2) A default implementation of getGlobal that checks for the Global in the servlet context and, if not present, creates and stores it into the servlet context.
3) A default implementation of createGlobal() that uses an app-spec property to define the name of the class to instantiate (i.e., same pattern as Visit).
Basically, Global should be just like Visit, except shared by all sessions/engines.
Because creating and storing the Global will not force the creation of a HttpSession, it should be done from setupForRequest(), like the many other shared objects (page source, template source, etc.).
I don't see that the Global should be any part of RequestContext.
I like the idea of Global; I'm increasingly enamored of solutions that leverage aggregation instead of inheritance.
I can whip my ideas together in a few minutes; I just wanted to see what Malcolm thinks of the changes.
----
Howard Lewis Ship
hlship-***@public.gmane.org
http://tapestry.sf.net
I would like to see the solution fleshed out a little bit.
What I see is that, if there's a particularily named object in the servlet context, it is accessible from the IEngine. I have to assume the intent was to override ApplicationServlet.init() to provide Global. This is a bit different than how many other similar constructs, such as Visit, are implemented.
I would like to see:
1) An overridable method on AbstractEngine to create the Global.
2) A default implementation of getGlobal that checks for the Global in the servlet context and, if not present, creates and stores it into the servlet context.
3) A default implementation of createGlobal() that uses an app-spec property to define the name of the class to instantiate (i.e., same pattern as Visit).
Basically, Global should be just like Visit, except shared by all sessions/engines.
Because creating and storing the Global will not force the creation of a HttpSession, it should be done from setupForRequest(), like the many other shared objects (page source, template source, etc.).
I don't see that the Global should be any part of RequestContext.
I like the idea of Global; I'm increasingly enamored of solutions that leverage aggregation instead of inheritance.
I can whip my ideas together in a few minutes; I just wanted to see what Malcolm thinks of the changes.
----
Howard Lewis Ship
hlship-***@public.gmane.org
http://tapestry.sf.net