hivemind-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Carman" <ja...@carmanconsulting.com>
Subject RE: HiveMind 2.0: Dependency Injection
Date Fri, 19 May 2006 13:33:06 GMT
I struggled with that too.  But, the assembly instructions tell HiveMind how
to assemble the instance that's returned.  So, I thought they should go
inside the <instance> (or <impl> or <implementation>) element.  The problem
with that is that the params for the <instance> have to coexist with the
assembly instructions.  

-----Original Message-----
From: Knut Wannheden [mailto:knut.wannheden@gmail.com] 
Sent: Friday, May 19, 2006 9:25 AM
To: hivemind-dev@jakarta.apache.org
Subject: Re: HiveMind 2.0: Dependency Injection

I think the advantage of having the assembly instructions outside the
<instance> element would be that all parameters inside <instance> are
parameters for the service implementation factory (as it is today),
whereas the assembly instructions are for the "outer" factory. Which
suggests some concept of nested factories. As in JCP really. Would
that maybe be a useful concept?

--knut

On 5/19/06, James Carman <james@carmanconsulting.com> wrote:
> Assembly instructions should go inside the <instance> element, as they
> pertain to that specific instance and not to the service point as a whole.
> Again, I'm not married to the syntax itself, just the ideas.  The
<instance>
> element could easily be renamed as <implementation> (or <impl> for
brevity)
> and they could live either directly inside a service point our outside it.
> If the <implementation> element lives outside of the <service-point> it
must
> include a service-id:
>
> <service-point id="MyService" interface="com.myco.MyInterface">
>
> </service-point>
>
> <implementation service-id="MyService" factory-id="MyServiceFactory">
> </implementation>
>
> Again, we can rename it whatever we want, but it might make sense to do it
> as <implementation> rather than <instance>.  Who knows?  I'm sure we can
> decide on something.
>
> -----Original Message-----
> From: Knut Wannheden [mailto:knut.wannheden@gmail.com]
> Sent: Friday, May 19, 2006 3:30 AM
> To: hivemind-dev@jakarta.apache.org
> Subject: Re: HiveMind 2.0: Dependency Injection
>
> James,
>
> That sounds like an excellent idea. I also quite liked Howard's idea
> about streamlining the syntax
>
(http://thread.gmane.org/gmane.comp.jakarta.hivemind.devel/2321/focus=2323).
> Maybe that could be combined with your idea. So maybe something like:
>
> <service-point id="MyService" interface="com.myco.MyService">
>   <instance factory-id="HibernateSessionFactoryFactory">
>      <factory-params-according-to-schema />
>   </instance>
>   <assembly autowire="false">
>      <inject property="myDao" value="service:MyDao" />
>      <inject property="myConfig" value="config:ConfigurationParameters" />
>      <listener service-id="MyEventSource" />
>   </assembly>
> </service-factory>
>
> What do you think?
>
> --knut
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: hivemind-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: hivemind-dev-help@jakarta.apache.org
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: hivemind-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: hivemind-dev-help@jakarta.apache.org
>
>

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




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


Mime
View raw message