New answers tagged


This is typically done with nuget packages in .NET, working with that ecosystem is probably the best step up from referencing projects directly, with the benefit that you can update your library without breaking your existing code that uses it via version pinning.


There is a reason why the hexagonal architecture proposed by Robert Martin is also called "ports and adapters". The low level implementation of your high level interfaces are most of the time (very straightforward) adapters from your application requirements (high-level policies) to concrete infrastructure. If these adapters get complex, I recommend ...


If you use logging as an example, then yes, you are right that if it was implemented strictly like you you DIP is described. But I would argue that there are two "classes" of infrastructure problems. Logging, Configuration, and Enumerations are examples of problems that have already been solved and rarely require DIP as you describe. But when it comes to ...


There's some detail missing in that picture. The Service interface isn't a general-purpose interface; instead it has methods geared specifically towards the needs of your application. Now, the idea with DI used in this way is that you want to be able to independently change, or even entirely replace, the implementation of the service. ServiceImpl packaged ...

Top 50 recent answers are included