I am in the process of refactoring some (extremely) tightly-coupled, legacy VB.NET interface code which transfers data between a SQL Server database (using direct calls to ADO.NET and stored procedures) and a SAP R/3 system.
My first concern has been to get the code under test and, so, I have been able to separate the business logic from the RFC calls to SAP on the one side. Now I want to be able to inject the main business object with either a dependency to a class that will handle the database calls or a mock object so that I can unit-test the business logic separately from the DAL.
However, I am not clear on the best way to separate the database calls from the business logic. Is there a best practice or pattern that could guide me here?