Application of Dependency Inversion Principle with ASP.NET Provider Model

Farfpoovere

New Member
I have an application which uses an \[code\]IPaymentService\[/code\] to process credit card payments. The payment service implementation (\[code\]CreditCardPaymentService\[/code\] or \[code\]CheckPaymentService\[/code\]) is injected into the application by a \[code\]PaymentProvider\[/code\] using the ASP.NET Provider Model.We also need these services to be reusable for different applications which may not have access to the \[code\]PaymentProvider\[/code\].The question is where to put the \[code\]IPaymentService\[/code\] interface? It can't be inside the application because there are multiple applications which need to use the service. It can't be inside the service because there are multiple services which implement this interface. I don't like putting the interfaces in their own project because then I have to add references everywhere. Is there another solution?
6zWC6.png
 
Back
Top