2

I have a 3 layered application.

  • Presentation Layer (PL): ASP.NET MVC app
  • Business Logic Layer (BLL) project
  • Data Access Layer (DAL) project

I need to add a Web Reference to a service for a payment gateway. Where does it go? PL or BLL?

P.S. Before using the Web service I need to retrieve some data from database and send that data to web service.

asked Dec 18, 2013 at 18:15

1 Answer 1

7

Since the actual operation isn't something the user needs to see then Presentation is out. What we have left is the Data Access and the Business layers. Since you aren't actually manipulating data from the payment gateway it's more of an external business process, which makes the Business layer the logical home for it.

answered Dec 18, 2013 at 18:26
1
  • 1
    Don't actually reference it from your BLL though. That will introduce a concete dependency, and you don't want that because you might want to stub it for testing, or the vendor might introduce a new version of the API, and then you'll need to have both versions in your code for a time. I normally give proxies to external services their own project, and code to them by interface. Commented Dec 19, 2013 at 11:16

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.