views:

110

answers:

2

When using Aspect Oriented Programming with Policy injection, how do you deal with policy errors gracefully in your design?

In Aspect Oriented Programming the objects should be unconcerned with how a particular policy is configured, but a particular policy may throw particular errors. What's the most graceful design to deal with that?

A: 

Why not have your aspect that injects the policy validate it/handle errors that may occur?

Bless Yahu
+1  A: 

If you consider the policy to be an "aspect" of the system then the specific aspect should handle everything that has to do with that policy. The objects should be unaware of the specific policy. This way, if you you need to change the policy in the future, you won't need to change anything in the objects.

Chrys