You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hivemind.apache.org by Daniel Feist <df...@technisys.net> on 2004/04/29 21:49:21 UTC
Overwriting service implementation contributions
I'm currently working with HiveMind to develop a set of reusable
components that will then be used in custom implementations.
Each component is independant and provides functionality on it's own but
is designed to be intelligent work alongside other components if they
are available. The project implementation obtains component services
via HiveMind and component services obtain references to the services of
other components via HiveMind.
Each component (HiveMind Module) defines its services and a default
implementation for each service to allow the component to be able to be
used on its own. When components are used together in a project
implementation it is quite possible that I may not want to use the
default implementation defined in the hivemodule.xml within the
components jar but rather use a custom one in effect overwriting the
implementation defined in the component with one defined in the project
implementation (which as its own hivemodule.xml).
I've had a look around and can't find how to do this with HiveMind in
it's current version.. Does anyone know how this can it be done? It's
almost as if i require one hivemodule.xml to have the final say and the
power to overwrite service implementation contributions already made in
other hivemodule.xml's.
I've added these ideas to the wiki
http://wiki.apache.org/jakarta-hivemind/ConditionalContributionsProposal
although i'm not too sure how related this is the the other proposals
made wih regard to 'ConditionalContributions'
Daniel Feist
My use case for conditional contributions is as follows: A project
implementation is made up of reusable self-contained components and an
amount of custom implementation. Each component is a HiveMind module as
if the custom implementation. Each component defines its services with
service points in its own hivemodule.xml (inside their jar's) along with
the default implementations for these services. This allows for each
component to be autonomous and be usable on it's on if nessecary. When i
use components for a specific implementation it maybe the case that i
don't want to use a default service implementation defined by a
component in it's hivemodule.xml but rather overwrite it and use another
implementation. I'm not sure how this fits into the general proposal but
I see it as a very common use case. Maybe its possible to have one
hivemodule that has the last say about implementations? Else how can
this use case be satisfied with HiveMind without having to open up the
component jar and change it's hivemodule.xml?
---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-dev-help@jakarta.apache.org
Re: Overwriting service implementation contributions
Posted by Daniel Feist <df...@technisys.net>.
I had missed http://jakarta.apache.org/hivemind/override.html , sorry!
SybmolSource's are really quite powerfull!
The solution to my use case is as follows, in case anyone is interested:
//PROVIDER COMPONENT MODULE
service-point (id=Provider interface=ex.override.Provider)
{
invoke-factory (service-id="hivemind.BuilderFactory")
{
construct (class="${ex.override.Provider}")
}
}
contribution (configuration-id=hivemind.ImplementationDefaults)
{
default (symbol=ex.override.Provider value=ex.override.ProviderDefaultImpl)
}
//IMPLEMENTATION MODULE
// ApplicationDefaults overrides FactoryDefaults
contribution (configuration-id=hivemind.ApplicationDefaults)
{
default (symbol=ex.override.Provider value=ex.override.ProviderCustomImpl)
}
Dan
Daniel Feist wrote:
> I'm currently working with HiveMind to develop a set of reusable
> components that will then be used in custom implementations.
>
> Each component is independant and provides functionality on it's own
> but is designed to be intelligent work alongside other components if
> they are available. The project implementation obtains component
> services via HiveMind and component services obtain references to the
> services of other components via HiveMind.
>
> Each component (HiveMind Module) defines its services and a default
> implementation for each service to allow the component to be able to
> be used on its own. When components are used together in a project
> implementation it is quite possible that I may not want to use the
> default implementation defined in the hivemodule.xml within the
> components jar but rather use a custom one in effect overwriting the
> implementation defined in the component with one defined in the
> project implementation (which as its own hivemodule.xml).
>
> I've had a look around and can't find how to do this with HiveMind in
> it's current version.. Does anyone know how this can it be done? It's
> almost as if i require one hivemodule.xml to have the final say and
> the power to overwrite service implementation contributions already
> made in other hivemodule.xml's.
>
> I've added these ideas to the wiki
> http://wiki.apache.org/jakarta-hivemind/ConditionalContributionsProposal
> although i'm not too sure how related this is the the other proposals
> made wih regard to 'ConditionalContributions'
>
> Daniel Feist
>
>
>
>
>
> My use case for conditional contributions is as follows: A project
> implementation is made up of reusable self-contained components and an
> amount of custom implementation. Each component is a HiveMind module
> as if the custom implementation. Each component defines its services
> with service points in its own hivemodule.xml (inside their jar's)
> along with the default implementations for these services. This allows
> for each component to be autonomous and be usable on it's on if
> nessecary. When i use components for a specific implementation it
> maybe the case that i don't want to use a default service
> implementation defined by a component in it's hivemodule.xml but
> rather overwrite it and use another implementation. I'm not sure how
> this fits into the general proposal but I see it as a very common use
> case. Maybe its possible to have one hivemodule that has the last say
> about implementations? Else how can this use case be satisfied with
> HiveMind without having to open up the component jar and change it's
> hivemodule.xml?
>
> ---------------------------------------------------------------------
> 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