[dev] Cyclic dependencies in binders

Gunnar Wrobel p at rdus.de
Tue May 11 07:22:47 UTC 2010


Quoting Jan Schneider <jan at horde.org>:

> There's a problem with creating binders for objects with cyclic dependencies.
>
> I'm currently refactoring Horde_Alarm, and it depends on  
> Horde_Notification if displaying alarms as notifications.  
> Horde_Notification OTOH depends on Horde_Alarm because it triggers  
> the alarm system before displaying notifications, so that it can  
> push any new alarms on the stack right before.
>
> Theoretically I would have two binders and both use the injector to  
> get the other object. But this obviously leads to an endless loop.
>
> Any ideas how to solve this?

I did not look at the code now but I assume Horde_Notification needs  
to be fixed so that it does not depend on Horde_Alarm. The problem  
should not only exist for the binder but for packaging, too. The  
notification system seems to be the more generic module so Alarm  
should depend on it. But not the other way around.

Cheers,

Gunnar

>
> Jan.
>
> -- 
> Do you need professional PHP or Horde consulting?
> http://horde.org/consulting/
>
>
> -- 
> Horde developers mailing list - Join the hunt: http://horde.org/bounties/
> Frequently Asked Questions: http://horde.org/faq/
> To unsubscribe, mail: dev-unsubscribe at lists.horde.org
>







More information about the dev mailing list