In Symfony 2, we will have the dependency injection container that will 
solve this kind of issues quite easily.

Fabien

--
Fabien Potencier
Sensio CEO - symfony lead developer
sensiolabs.com | symfony-project.org | fabien.potencier.org
Tél: +33 1 40 99 80 80


Fabian Spillner wrote:
> A real world example:
> 
> I have a view cache which runs on multiple memcache servers, the cache
> configuration
> is made in factiories.yml and I want to create own memcache class for
> ex. data caching
> and I dont want to copy the configuration statically.
> 
> It would better if there is a ex. sfConfigurationCache class which can
> be passed into
> sfCache object for its initialization of configuration ex.
> 
> interface sfConfiguration
> {
>   public function get($key);
>   public function set($key);
> }
> 
> class sfConfigurationBase implements sfConfiguration
> {
>   public function __construct(sfCache $cache, ...)
>   {
>      // cache is for caching of configuration
>   }
> }
> 
> class sfConfigurationCache extends sfConfigurationBase
> {
> 
> }
> 
> and the sfCache provides the configuration class as parameter for its
> initialization:
> 
> class sfCache
> {
>   public function __construct(sfConfiguration $configuration, ...);
> }
> 
> and there is own config file for configuration schema:
> 
> configuration.yml
> 
> and the sfConfigurationManager manages the configurations, so that I
> can access a configuration directly:
> 
> $cacheConfiguration = sfConfigurationManager::getInstance()-
>> getConfiguration('memcache');
> $memcacheCache = new sfCacheMemcache($cacheConfiguration);
> 
> ...
> 
> What do you think about?
> > 
> 


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/symfony-devs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to