In my 9 years of consulting and implementing Tridion, I never wrote the same code twice... Kudos, Tridion -- you awesome beast! But every now and then I find myself needing the same low level handlers and I end up copy pasting them from somewhere.
For example, with Event Systems I always prefer putting the configuration in a System Component in Tridion. I put it maybe in the current Publication metadata or current Folder/Structure Group meta. I always end up writing the same code to handle the reading of this Component, checking for modifications, caching it for a few minutes, then making the configuration values available inside some object model.
Recently, this annoyed me enough to write an Event System base-project that takes care of this once and for all... Enter the Yet Another Event System framework. Functional requirements:
For example, with Event Systems I always prefer putting the configuration in a System Component in Tridion. I put it maybe in the current Publication metadata or current Folder/Structure Group meta. I always end up writing the same code to handle the reading of this Component, checking for modifications, caching it for a few minutes, then making the configuration values available inside some object model.
Recently, this annoyed me enough to write an Event System base-project that takes care of this once and for all... Enter the Yet Another Event System framework. Functional requirements:
- Rapid development -- provide a base ready to be used in actual Event System development
- System Component is in free format -- provide a consistent API to parse it to object model and extract configuration values from it
- Read System Components from various places:
- Publication meta
- specific Folder/SG meta
- current Folder/SG meta
- Allow caching of the Configuration Component such that performance is not hindered by too many reads, parses, updates of the System Component
- Configurable caching time interval
- Allow searching for System Component recursively (configurable) into the parent Folder/SG
- Allow merging of values from several System Components found/specified -- this one is great for BluePrinting. Different Configuration Component can be created in different Publications, then they can simply be used in a lower Publication, localized or not and their values are merged/overridding previous values
- Easy deployment -- file-system only, don't bother with GAC!
Next post will present the actual code and provide some samples.
Comments