Mark Rogers
Mark Rogers

Reputation: 97707

Errors in Aspect Oriented Programming with Policy Injection

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?

Upvotes: 0

Views: 202

Answers (2)

Chrys
Chrys

Reputation: 646

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.

Upvotes: 2

Bless Yahu
Bless Yahu

Reputation: 1341

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

Upvotes: 0

Related Questions