Questions tagged [policy-injection]

29 questions
37
votes
4 answers

Policy based design and best practices - C++

struct InkPen { void Write() { this->WriteImplementation(); } void WriteImplementation() { std::cout << "Writing using a inkpen" << std::endl; } }; struct BoldPen { void Write() { std::cout << "Writing using a boldpen"…
Navaneeth K N
  • 15,295
  • 38
  • 126
  • 184
3
votes
2 answers

Where can I get a simple explanation of policy injection?

I'd like a dead simple explanation of policy injection for less-informed co-workers. Where is a good resource for this? I learned about policy injection from the entlib help files, which I'm sure aren't the best option.
Matt Casto
  • 2,150
  • 1
  • 22
  • 32
3
votes
5 answers

What's the best way to tell if a method is a property from within Policy Injection?

I've got a custom handler applied to a class (using the Policy Injection Application Block in entlib 4) and I would like to know whether the input method is a property when Invoke is called. Following is what my handler looks…
Matt Casto
  • 2,150
  • 1
  • 22
  • 32
2
votes
3 answers

Logging using policy injection application block

Hi All I want to ask, how to use policy injection application block to log methods entry and exit in these cases : Case1 : in case of logging events handlers of a web form controls, you know the class let's say _Default must be inherited from class…
netseng
  • 2,226
  • 6
  • 24
  • 28
2
votes
3 answers

Applying policy based design question

I've not read the Modern C++ Design book but have found the idea of behavior injection through templates interesting. I am now trying to apply it myself. I have a class that has a logger that I thought could be injected as a policy. The logger has a…
Arthur
  • 304
  • 5
  • 12
2
votes
0 answers

Policy Injection with Unity as AOP solution

This is the path our company is looking at as a solution for AOP (cross-cutting concerns), but I still have not been able to find any current feedback or samples/real-world examples of this methodology, only posts that are three or four years old. …
Peter Howe
  • 429
  • 6
  • 19
1
vote
0 answers

How to configure the NamespaceMatchingRule(IEnumerable) in unity 2.0 xml configuration file?

How should I pass the IEnumerable to one of the overloaded constructor of the NamespaceMatchingRule using the unity 2.0 configuration file?
surajnaik
  • 725
  • 2
  • 10
  • 26
1
vote
1 answer

Policy Injection Application Block in real world apps?

The PIAB of the Microsoft Enterprise Library looks like it could be used for some pretty cool things. Many people were questioning how it would perform in real world applications, due to its use of remoting-based interception techniques. I haven't…
1
vote
1 answer

How do I configure Unity 2.0 Policy Injection to use custom attribute matching rule in configuration file?

How do I configure Unity 2.0 Policy Injection to use custom attribute matching rule in configuration file? What I want is to translate the following code snippet in the unity configuration file. myContainer.Configure() …
1
vote
0 answers

Specify policy for an interceptable type

Suppose I have the following code: class Program { static void Main(string[] args) { IUnityContainer container = new UnityContainer(); container.AddNewExtension(); container.RegisterType( new…
1
vote
1 answer

Transparent logging in ASP.NET with EntLib

I'm modifying legacy asp.net project. I want include transparent logging for some namespaces, classes and methods. I use EntLib. Can I configured Police Injection Settings for transparent logging my app? What I must do for logging all methods in…
GraDea
  • 588
  • 7
  • 23
1
vote
1 answer

Unity Interception From Base Class

I want to declare interception to Unity for a particular base type, and have that interception be honored for all derived types automatically. I see two different SO posts that are the same topic, but neither has the answer I'm looking…
Brent Arias
  • 29,277
  • 40
  • 133
  • 234
1
vote
1 answer

Policy Injection Intercept not working for WebAPI Controllers

I'm implementing Policy injection with web api and for DI we are using custom DependancyResolver. I have used InterfaceIntercept approach to implement policy injection. It is working fine in case of Classes(custom created classes) but Policy…
1
vote
1 answer

Security and Policy Injection Application Block

I have a mixed UI (Win App, WPF App, and soon an ASP.NET MVC App) setup, so far I'm using Client Application Services for security. I know how to programmatically get a user authenticated and doing so is working beautifully. However... I want to…
Adron
  • 2,371
  • 7
  • 25
  • 30
1
vote
0 answers

Tracer Class for Automatic Logging of Method Entry and Exit

I want tracing in every function Entry and Exit. Say my class contains three methods MethodA MethodB MethodC... Through the Instance someone called MethodA and methodA calls MethodB and MethodB calls methodC public class test { Public void…
1
2