I am designing an app and I am using a n-layer architecture, I have:
- a presentation layer
- a domain bussines layer
- a data acccess layer
- a cross-cutting layer
Then I am trying to isolate my project from an specific DI framework, that is create my own IContainer interface and ensure that my components depends only to this interface.
Then I have 2 questions.
1 - Is this last a good practice ?
2 - (And the more important) Is dependency injection a cross-cutting concern ? That is can I place the DI related components in the cross-cutting layer ? If the answer is not where can fits those components.
I ask this because when I dive in the architecture design guides about cross-cutting concerns they usually mention:
- Security
- Validation
- Configuration handling
- Exception handling
- Loggings
- Caching