Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 6 down vote accepted

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.

share|improve this answer
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. –  Mr Cochese Dec 19 '13 at 11:16

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.