3 ms·
I should mention that one thing that I always do with dependencies, these days, is encapsulate them. I use things like Dependency Inversion or Dependency Injec
by ChrisMarshallNY 6y ago
I should mention that one thing that I always do with dependencies, these days, is encapsulate them.
I use things like Dependency Inversion or Dependency Injection, or simple "glue" APIs.
This is from being burned by integrating dependencies into my projects, and painting myself into corners.
It helps to do things like swap out DB backends, or things like mapping libraries. YAGNI is important, but it's also important to encourage flexibility. Dependency encapsulation is pretty much perfect for that.
Of course, there are probably cases where it's impossible to use some dependencies without making them integral parts of the project, but it's been my experience that I can write lots of stuff, based on modules.
My work is basically a clump of dependencies; it's just that I wrote the dependencies.
I like modular architectures, with each module/layer as an independent-lifecycle project; complete with testing, documentation, and APIs. Takes a bit longer to write the modules, but the integration is quite smooth.