global object
"Howard M. Lewis Ship" <[email protected]> Thu, 9 Jan 2003 21:14:06 -0500
| Newsgroups | gmane.comp.java.tapestry.contrib |
|---|---|
| Message-ID | <007001c2b84d$f45b6c60$3dc41e42@howardczkz2sl3> |
This is a multi-part message in MIME format. ------=_NextPart_000_006D_01C2B824.0B515C10 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 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. =20 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 [email protected] http://tapestry.sf.net ------=_NextPart_000_006D_01C2B824.0B515C10 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=3DContent-Type content=3D"text/html; = charset=3Diso-8859-1"> <META content=3D"MSHTML 6.00.2719.2200" name=3DGENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=3D#ffffff> <DIV><FONT face=3DArial size=3D2>I would like to discuss the global = property added=20 to IEngine.</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>I would like to see the solution = fleshed out a=20 little bit.</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>What I see is that, if there's a = particularily=20 named object in the servlet context, it is accessible from the = IEngine. =20 I have to assume the intent was to override = ApplicationServlet.init() to=20 provide Global. </FONT><FONT face=3DArial size=3D2>This is a bit = different=20 than how many other similar constructs, such as Visit, are=20 implemented.</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>I would like to see:</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>1) An overridable method on = AbstractEngine to=20 create the Global.</FONT></DIV> <DIV><FONT face=3DArial size=3D2>2) A default implementation of = getGlobal that=20 checks for the Global in the servlet context and, if not present, = creates and=20 stores it into the servlet context.</FONT></DIV> <DIV><FONT face=3DArial size=3D2>3) A default implementation of = createGlobal() that=20 uses an app-spec property to define the name of the class to instantiate = (i.e.,=20 same pattern as Visit).</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>Basically, Global should be just like = Visit, except=20 shared by all sessions/engines. </FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>Because creating and storing the Global = will not=20 force the creation of a HttpSession, it should be done from = setupForRequest(),=20 like the many other shared objects (page source, template source,=20 etc.).</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>I don't see that the Global should be = any part of=20 RequestContext.</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>I like the idea of Global; I'm = increasingly=20 enamored of solutions that leverage aggregation instead of=20 inheritance.</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>I can whip my ideas together in a = few minutes;=20 I just wanted to see what Malcolm thinks of the changes.</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>----<BR>Howard Lewis Ship<BR><A=20 href=3D"mailto:[email protected]">[email protected]</A><BR><A=20 href=3D"http://tapestry.sf.net">http://tapestry.sf.net</A><BR></FONT></DI= V></BODY></HTML> ------=_NextPart_000_006D_01C2B824.0B515C10-- ------------------------------------------------------- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com