This has been occuring to me as well. Of course, you can simulate this by 
creating a meta-interface
that implements the other interfaces ... it would just be nicer if HiveMind 
allowed a list of
interfaces.

My vision of HiveMind is lots of simple little interfaces and services: 
aggregation rather than
inheritance or composition.

In you example, Add/add() is definately part of the service interface.

Startable/start() and Stopable/stop() are not; that's part of the service 
implementation.  I think a
better approach to this particular situation is to turn Startable and Stopaple 
into event
interfaces, and use the BuilderFactory to registry your Add service 
implementation as listeners.

--
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Jakarta Tapestry
Creator, Jakarta HiveMind
http://howardlewisship.com


> -----Original Message-----
> From: Nelson, Randy [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, June 10, 2004 9:16 AM
> To: '[email protected]'
> Subject: multiple interfaces for a service-point question
> 
> 
> The service-points only allow a service to implement 1 
> interface.  However,
> there are times when it seems like it would be useful to 
> specify that your
> service implements more than one inteface as in the description below.
> Hivemind hasn't been implemented that way, so I am sure there are keys
> reason why not so I was just wondering what was the thought 
> process behind
> it?
> 
> 
> Example:
> 
> interface Add {
>   public void add(int arg0, int arg1);
> }
> 
> interface Startable {
>   public void startup() throws Exception;
> }
> 
> interface Stopable {
>   public void shutdown() throws Exception;
> }
> 
> =====
> 
>   <service-point id="Adder" interface="hivemind.examples.Addable">
>       <create-instance class="hivemind.examples.impl.AdderImpl"/>
>   </service-point>
> 
> ...
> 
>   <contribution configuration-id="Startup">
>     <task title="Adder"  order="100" >
>       <invoke-startup service-id="hivemind.examples.Adder" />
>     </task>
>   </contribution>
> 
>   <contribution configuration-id="Startup">
>     <task title="Adder"  order="1000" >
>       <invoke-shutdown service-id="hivemind.examples.Adder" />
>     </task>
>   </contribution>
> 
> =====
> 
> You have an Adder service that implements Addable.  You'd 
> like to be able to
> contribute this to a "Startup" service or a "Shutdown".  
> However, you don't
> want to make all Addable services have to implement either/both of the
> Startable or Stopable interfaces. (In this case I am 
> expanding "Panorama
> Startup" example).  Are there ways to do this without the 
> Adder service
> implementing multiple interfaces and without combining all 
> the methods into
> 1 interface?)
> 
> -Randy
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to