Optional Dependency

3 views
Skip to first unread message

Matias

unread,
Apr 18, 2011, 9:18:43 AM4/18/11
to Symfony Components
Hi,

I read a few posts about optional dependencies, but couldn't find
anything conclusive.

I have a pretty big app, and want some objects to be optional
(including loggers, and profilers).
Now in production, I want to avoid creating loggers and profilers,
pass them around, and simply disable them, because I want to avoid the
overhead of creating objects I don't intend to use.

I'm looking for a solution that would be like:

addOptionalArgument('serviceNameImDependingOn', [...]);

or

addOptionalMethodCall('serviceNameImDependingOn', [...]);


Is there something like this?

Thanks in advance.
Reply all
Reply to author
Forward
0 new messages