avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Donald <dona...@apache.org>
Subject Re: Service interface
Date Wed, 22 Aug 2001 06:46:25 GMT
On Wed, 22 Aug 2001 16:34, Leo Simons wrote:
> what's our definition of a Service? 

A behavioural or "work" interface. ie An interface a client can use to do 
something. Not sure how to make that more clearer though ;) Maybe if we 
described service as the java interface for a Role ??? Not sure.

It differs from turbines definition in a few key points. Turbine combines 
lifecycle management and work interface, two othogonal concepts. Phoenix 
allows multiple instances and implementations of a Service to be inside same 
JVM. Turbine implementation mandates a specific access approach while Phoenix 
can theoretically be accessed via any method (since it uses ComponentManager 
abstraction) ... however not sure if this is really needed.

> We used to have a nice one, no? Can't find it....

not sure. My definition is in my head. Are you volunteering to write a sane 
description ? ;)

>
> - Leo
>
> from javadoc:
> "This is a marker interface that all Services must implement. A Service is
> a behavioural contract that an object implements."
>
> from blockinfo spec:
> "The services section documents the services that this block can offer
> other Blocks. The service instances indicate an interface and a version.
> The interface MUST extend org.apache.phoenix.Service. This section is
> optional and a Block can choose to not offer any services."
>
> from turbine:
> "Services are singletons within the Turbine Framework which have pluggable
> implementation, and are capable of participating in the Turbine startup and
> shutdown. As Services are Singletons, there is only one instance of each
> service in the system. Memory or connections are allocated once only and
> the internal state is common to all requesting clients. Services can access
> ServletConfig at system startup time to process relative paths and similar
> functionality, they can also access RunData on the first Turbine doGet
> execution to get the environment Turbine is operating under and with.
> Services can also initialize themselves before they are requested by the
> client for the first time. A Service that is never used will not allocate
> resources to itself. A Service can also execute actions upon the system
> being shutdown, such as closing open connections. The Singleton pattern
> also allows for the Services to be accessed from anywhere within your code.
>
> The Life Cycle of a Service begins with the Services constructor. A Service
> does not do much in it's contructor. Especially it should not allocate any
> costly resources like large memory structure, DB or Network connections,
> etc. The Service may be in the properties file, but unless a client using
> the application needs the Service in question, there is no point starting
> the Service."
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: avalon-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: avalon-dev-help@jakarta.apache.org

-- 
Cheers,

Pete

*-----------------------------------------------------*
* "Faced with the choice between changing one's mind, *
* and proving that there is no need to do so - almost *
* everyone gets busy on the proof."                   *
*              - John Kenneth Galbraith               *
*-----------------------------------------------------*

---------------------------------------------------------------------
To unsubscribe, e-mail: avalon-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: avalon-dev-help@jakarta.apache.org


Mime
View raw message