Fabien Potencier wrote about the service container they were working toward earlier this year:
http://fabien.potencier.org/article/16/symfony-service-container-the-need-for-speed That is a 6 part series about how he envisions dependency injection in Symfony. On Oct 23, 6:43 pm, jukea <jkea...@gmail.com> wrote: > Hi, > > I just went through the whole DI documentation, but I'm still left > with 2 question : > > I want to build an environment where plugins will define services. > I'm planning have each plugin specify their own service definitions, > in XML too, which I think would be the way to go about it. > > The 1st question is : how can I make dependencies optionnal ? E.g: > plugin A *may* use plugin *B* in the case it is installed. How can I > express that in the XML service description ? > > In other words, I was wondering if there was a XML equivalent of > > $def = new sfServiceDefinition(); > $def->setClass('myProjectService'); > if($container->hasService('time_tracking')) > $def->addMethodCall('setTimeTracker',array(new sfServiceReference > ('time_tracker'))); > > If not, how would you manage the following situation : > > to test if a service exists, it must have been declared, but you > cannot control the order in which your plugin's code would be executed > (which in this case should be related to the service dependency graph, > starting with the leafs and so on) > > thanks in advance for clarifying this , > > Julien Keable --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~----------~----~----~----~------~----~------~--~---