Respect / Config

A powerful, small, deadly simple configurator and dependency injection container DSL made to be easy
http://respect.github.io/Config
Other
98 stars 7 forks source link

Cache #18

Open alganet opened 12 years ago

alganet commented 12 years ago

At some point, we're going to need cache for containers. I have absolutely no plans to include a cache library inside the Config's core, but the Container and Instantiators need to be cacheable, or at east serializable to a string that can be cached.

I'd have success serializing a virgin container, that haven't instantiated any instance yet (a full lazy loaded container). Quickest way to cache things I see is to flag the container/instantiator as "dirty" when some instance comes out of the lazy zone. Only "virgin" containers would be serializable.

The idea is to cache the entire container as soon as its loaded from INI files.

We also need to reduce statefullness from the component's classes. The least information we keep on properties the better for cacheability. For example, we could get rid of the Instantiator->params attribute after Instantiator parsing.

Thoughts?