And I must say; I am in love! I hereby solemnly declare that I never will use any other way to implement non-functional requirements. As long as I have a say in the question.
Why - you ask? Because all other way is stupid! (I've picked up some Linus Torvalds style) Don't code - configure!
Here is the example that really convinced me; With a quite simple (very simple if you use the configuration tool for Enterprise Library) configuration block I got the results from all the methods in a certain interface (system values from database) to be cached.
Do you hear me? NO CODE did that! And it's so beautiful that my eyes are filled with tears.
Here is my configuration:
<!-- Caching policy for IDaVardeForrad REQUIRED! -->
<add type="Microsoft.Practices.EnterpriseLibrary.PolicyInjection.MatchingRules.TypeMatchingRule, Microsoft.Practices.EnterpriseLibrary.PolicyInjection, Version=220.127.116.11, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
name="Type Matching Rule">
<add match="IdaVardeForrad" ignoreCase="false" />
<add expirationTime="00:01:00" order="0" type="Microsoft.Practices.EnterpriseLibrary.PolicyInjection.CallHandlers.CachingCallHandler, Microsoft.Practices.EnterpriseLibrary.PolicyInjection.CallHandlers, Version=18.104.22.168, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
name="Caching Handler" />
If you liked this post ... here's more for you:
Published byon Last updated