I'm implementing the repository pattern on an existing system, predominantly in order to be able to unit test my business logic layer in isolation. But i've concerned I have a layer too many, and advice would be greatly appreciated. There is no ORM in place, SQL Server is used as the database.
I have the following:
- DataMapping Layer - linking objects to database tables
- Repository Interface
- Repository Concrete Implementation
- Business Logic Layer
- Presentation Layer
I find that I am often creating a method in the Repository Concrete Implementation which is returning a simple piece of data (an Expiry Date - DateTime variable for example), then putting together a Business Logic Layer method that is running the Repository Concrete Implementation method and returning it to the Presentation Layer.
Is there a case for the Presentation Later calling the Concrete Implementation method direct if the BLL is not adding in any additional logic? And only using a BLL method if there is additional logic to Unit Test?
I am using dependency injection to manage the Concrete Impementation.
Thanks.