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



"Thiago H. de Paula Figueiredo" <thiag...@gmail.com> 
15.07.2009 14:18
Bitte antworten an
"Tapestry users" <users@tapestry.apache.org>


An
"Tapestry users" <users@tapestry.apache.org>
Kopie

Thema
Re: Dynamic service binding based on symbol source







Why wouldn't a buildXXX() method injecting the symbol as a parameter and 
some ifs or switch statements work in your scenario?

-- 
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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


Reply via email to