Policy and Dependency Injection

Topics: CodePlexContainer, ObjectBuilder
Aug 13, 2007 at 7:20 PM
I have started this rather complex project which I suppose requires Dependency Injection framework. Project background - We have created metadata for all our entities, and we need to have security around each property depending on the logged in user and the requested data. I have created a group of rules around each Page call, the rules depending on the data defines the security for the object property. example Company page has company name and its ticker, depending on the logged user and whether the company is public or private a user can view the ticker field. To achieve this we pass the company object to the rule engine. The rule engine for this example will state that if comapny.isPublic property is true than the level for company.ticker = VIEW else it will be INVISIBLE. Now we do not want to change the getters of all our entities therefore we need to have an injection pre call which will check if company.ticker property is View or not if View than company.ticker will return correct value else it will return String.empty. The levels for the properties of the company object are stored in the base class hash table property. So when the rule engine is called it will first populate the property levels for company object in the company base class hashtable, when the user tries to access Company.Ticker get property it should go check in the base class hashtable whats the LEVEL for the Ticker property and accordingly return the value. Can anyone let me know if using dependency injection my problem would be solved and can anyone provide a sample code which is similar to my requirement.
Thanks,
Aug 13, 2007 at 7:22 PM
Edited Aug 13, 2007 at 7:22 PM
same