> Turbine <[EMAIL PROTECTED]> wrote:
> First off, I'm grappling with this design as much as everyone else,
> I'm trying to push this issue forward so we can keep moving. It
> seems to me that we've stagnated in some areas(and a lot of
> folks are busy).
>
> This Services design was put forth by Brett McLaughlin, so I'll try to
answer the best I can.
>
> > Okay, no help so far, so let me try another question. What is the
purpose of init(Object)?
> To pass any (if any) information needed on to the Service and
> also check that the Service is ready to do what ever it is expected
> to do by checking the isReady flag. In the example of lets say
> a Webmacro Service you would pass the RunData object to init(runData)
> and it would check to make sure the Template engine is ready, etc...
I want to build a Webmacro Service. So I build an init that takes a RunData
object. And let's say execute() would add the requested templates output to
the response stream. Let's say a layout is using my WebmacroService to
process this type of request. So two requests come in and my service sees
the following:
layout called init(data1)
layout called init(data2)
layout called execute()
It seems very complicated to build the service so that it knows whether it
whould be using data1 or data2 to perform the execute().
> No. A Client should always call init() - execute(). However
> the service developer could have a service the does some one
> time initialization on the first call but should always at a minimum,
check the isReady flag. Let's say I create an Object pool. In the init the
client passes the object to pool. My init would first check to see if the
pool is started (isReady) then maybe check to see if
> this is the proper type of object for the pool (instanceof) and then
> .
>
What does this mean "forward the object to the actual execute"?
Sorry for being so dense, I have tried reading the discussions on this
topic, but am having difficulty understanding it.
John McNally
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Problems?: [EMAIL PROTECTED]