I posted to following on the spring.net forum but also hoped I may get some value views here:
I am looking at some advice as to how I might achieve the following requirement.
Firstly some background - I am using Spring.NET to achieve IOC depdenecny injection in to my asp.net c# multi tier web application. Injection is achieved via spring.net xml configuration file with all my development achieved by developing against interfaces and injecting in an interface implemented class where required. This all works fine for me. My knowledge would be intermediate level I believe.
I have ran in to the problem and looking to achieve a solution for it.
To take for example I have a class with several methods where they all retrieve from a database, data being cached for a period of time.
I want to have freedom to inject in to each method the characteristics of the caching eg. time for it to live in cache etc. So rather than inject in class to where its required, I also want to be able to inject values in to methods.
I could go along the approach of creating properties on the class for each method but this gets messay, or injecting in settings to my class. My preference is to control each method via spring injection.
So any ideas how this can be achieved as I expect it something than others may have encountered.
One possible idea that I have come up with is to somehow inject an attribute on to each of the method via spring with attribute having properties with the values that required in the method eg cache duration etc. Is this a feasible solution? If so, could anyone assist me with configuring such.
Or if anyone has any other ideas, it would be great.