You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I love Polly but i dont like having to have hard coded references to Polly all over my code base. I wonder if you would consider making Policy injectible, maybe by publishing an IPolicy interface?
This would allow me do decouple your implementation from my code easier and i can inject Circuit Breakers into my services.
Ive blogged here (mentioned by Scott Hanselman) about how i solved this issue, but i think it could be made easier.
The text was updated successfully, but these errors were encountered:
If I provided an IPolicy interface, you would still have references to Polly all over your code base.
The point of decoupling is to shield your code from third party code. To do this, you would create the interface that your code relies on (IPolicy) and then implement it using Polly (as you have done), or some other exception handling library.
The point is that your code only knows about your own interface which you inject everywhere. You could use some other library, and your code would not care. If I defined an IPolicy that you used everywhere and you wanted to change libraries, you are stuck.
I love Polly but i dont like having to have hard coded references to Polly all over my code base. I wonder if you would consider making
Policy
injectible, maybe by publishing anIPolicy
interface?This would allow me do decouple your implementation from my code easier and i can inject Circuit Breakers into my services.
Ive blogged here (mentioned by Scott Hanselman) about how i solved this issue, but i think it could be made easier.
The text was updated successfully, but these errors were encountered: