This is good, but just having an instance of a tool is not sufficient.
I would like to see that an initial template is loaded; which contains
some additional logic which populates the current context (the startup
and the request level).
I mean as an example:
A. service startup:
1. properties states some tools and factories
2. init.vm template specifies some other constants and
derived values (e.g. loading some XML files into the
context via a JDOM tool). The template output is
is irrelevant at this stage and should be ignored.
3. This template could mask out some tools that should not
be visible any more via simple #set's.
B. per request:
1. some more tools are loaded
2. some request dependant defaults and constants
are loaded (via a template, the template output
could be ignored to avoid any random spaces and
empty lines which may be emitted.)
C. The requested screen template is then rendered
In general it is a nice generalization to have the initial
tools accessible via something like $tools.xml... and the
request ones via $app.db... But I did like the naming
convetion presented by WM, where the XmlTool.class was placed
into context as $Xml, etc. Maybe instead of using this
automagic naming convetion, if it comes out of the properties
file, it could also specify the full context name of the tool.
For my application I'll doing it this way (if nothing
better comes up):
* $Class.newInstance tool placed at startup
* init.vm loading the initial tools and constants,
* then per request a Default.java populating anything to be
computed
* this or the parent class loads a service.vm for request
level context constants and buisiness objects.
* Finally the requested template is loaded with the turbine
mechanism.
This way I can control the naming scheme...
Just my 2c, for whatever its worth.
:) Christoph
Jon Stevens wrote:
>
> Ok,
>
> Jason (primarily) and I implemented a portion of the PullModel within
> Turbine that allows for you to use a configuration file based methodology to
> place objects into the "global" scope of a Context. In other words, when the
> VelocityService is started, it will attempt to load any "tools" that you
> have defined and then place them into your "toolbox" which is essentially a
> nested Context object (Velocity supports the idea of nesting a Context
> within another Context).
>
> This is a good first start for making tools easily available. In fact, Jason
> also included his first tool which is a UIManager (@see
> org.apache.turbine.util.pull.UIManager.java). The advantage of this is that
> the class is then available to you on a global basis at any point both
> within your all of your Modules but also within your templates. One thing to
> note is that since these tools could be accessed by multiple threads at the
> same time, they need to be threadsafe as well as connectionsafe (ie:
> multiple connections could be accessing the tool at the same time).
>
> The next step is to implement the second step of the process which is to
> create an additional portion that will allow us to have per-connection tools
> placed into the toolbox. These will be re-instantiated for each request
> (around the time the Page Module is executed) and then destroyed when the
> processing is over. I'm going to work on this part today and it should just
> be an extension of what we have in the PullService.
>
> thanks,
>
> -jon
>
> --
> Honk if you love peace and quiet.
>
> ------------------------------------------------------------
> To subscribe: [EMAIL PROTECTED]
> To unsubscribe: [EMAIL PROTECTED]
> Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
> Problems?: [EMAIL PROTECTED]
--
==============================================================
Deutsches Zentrum fuer Luft- und Raumfahrt (DLR)
Deutsches Fernerkundungs Datenzentrum (DFD)
DLR-DFD, Muenchner Strasse 20, D-82234 Wessling, Germany
============= Currenlty relocated to ESA-ESRIN ===============
ESA ESRIN Tel: +39 06 941 80 589
c/o Christoph Reck (DLR) Fax: +39 06 941 80 512
Via Galileo Galilei mailto:[EMAIL PROTECTED]
I-00044 Frascati (Roma) http://www.dfd.dlr.de
==============================================================
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]