I managed to implement exactly what I wanted with a single additional
bind method overload on ServiceBinderImpl. As usual with Tapestry a fair
bit of head scratching but very little resulting work!

Have submitted with patch as an enhancement request. If anyone is
interested in the detail (or wants to vote for it), you can find it
here...

        https://issues.apache.org/jira/browse/TAP5-780

Regards, Alfie.

-----Original Message-----
From: Kristian Marinkovic [mailto:kristian.marinko...@porsche.co.at] 
Sent: 15 July 2009 14:20
To: Tapestry users
Subject: Re: Dynamic service binding based on symbol source

hi Alfie,

i think i understand your problem....

in such situations i define a service with a dummy implementation. 
now another module can override the service with a correct
implementation.
its also useful to break up cyclic dependencies.

lets say if have a security module that provides a SubjectService.
because
the user data is managed by another module that itself depends on the 
security module i cannot have a SubjectService implementation within the
security module that loads the user data (using the user module
services). 

Instead i have a dummy implementation that throws an exception. only if 
the 
user module is deployed it will override this dummy implementation with
a 
proper 
one. (see ServiceOverride for more details)

in other circumstances i have a chain with a defined interface any other
module can contribute to. now when i build the services (builder method)
i delegate it to the chain and it will return the appropriate 
implementation.
so a chain element can decide to return a specific implementation if it 
needs to and stop the chain.

i hope this helps

g,
kris

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to