We have a website application and a web services layer. The website must use the web service for data per our requirements. Both layers are being build by me. I'm curious if my layout for DI is justified.
Common entities project - shared by both the website and web service layer
ASP.NET MVC website -- MVC service layer - injects concrete class to contain business rules for the website/pages -- -- Data repository - injected by MVC service layer. In this case, various wrappers for web service calls currently, but things may change
Web services -- Service/business layer - injected classes to handle business logic for services -- -- Data repository - injected data classes used by business layer above. Can be ADO or EF.
So, any call can be up to 4 layers of injection. I see benefit in this, as each part can be isolated and tested. In some cases, the business layers can just "pass through" to the data layer (e.g., GetClientByID(int id) has little logic), but are there in case rules change. I feel the injections for the data layer abstract away any auto-generated entities from the web services. Luckily, in my case currently, it shares a common project, but who knows if this stays that way.
Is this too much? Thanks.