Feature Requests item #660372, was opened at 2002-12-31 13:36 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=354754&aid=660372&group_id=4754
Category: framework Group: None Status: Open Resolution: None Priority: 5 Submitted By: Malcolm Edgar (malcolm_edgar) >Assigned to: Malcolm Edgar (malcolm_edgar) Summary: Add Global object Initial Comment: Global ====== Aim --- Provide a shared object that can be used for globally accessed data or utility methods. Currently it is recommended that the SimpleEngine be subclassed to provide a point to hang shared data off, or access global data via the ServletContext accessed from the IRequestCycle. Conceptually it simpler to have a global object available throughout the framework. Design ------ A global bean object modelled on the access style of the Visit object. The global object would have an accessor method added to IPage interface: public Object getGlobal(); This object would be instantiated via a no args constructor, with the class name specified in the Application.specification as is done with the visit object. This object should follow a singleton style design pattern, so their is only ever one instance available. This object should be stored in the ServletContext under the key 'net.sf.tapestry.global' so that it can potentially be shared with other Servlet components. Scope ----- Global object: shared application data Visit object: user specific data Persistent page properties: user page specific data Example Usage ------------- Application properties Application constants Cached data Connection DataSources ---------------------------------------------------------------------- >Comment By: Malcolm Edgar (malcolm_edgar) Date: 2003-01-02 03:20 Message: Logged In: YES user_id=592290 Attached is an implementation of Global object. Should this feature be included in 2.3 or 2.4 ? In summary the ApplicationServlet init() instantiates the global object (classname defined as application specification parameter) and stores it the the ServletContext. AbstractEngine has a transient _global variable which is set in the setupForRequest() method. AbstractPage delegates getGlobal() to AbstractEngine. Java classes: ApplicationServlet, RequestContext, AbstractEngine, AbstractPage, IEngine, IPage ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=354754&aid=660372&group_id=4754 ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Tapestry-developer mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/tapestry-developer
