@hynek ah, yes, so it appears I was familiar with the idea from my previous job, but not the name.
Let me rephrase to see if I've understood:
The term "dependency injection" is specifically about your code getting its dependency as input arguments. Service locator is a different mechanism, that shares a common goal.
Aside from that, hexagonal architecture cares more about where you draw your lines, what you call your components and interfaces.
@hynek so to put that together in a sentence:
My previous job was using a hexagonal architecture, with different components for the http views, the business logic, the database access, and the network call to other services.
All of this was tied together with dependency injection (implemented is scala as argument to classes, with the glue being one big main that instances everything in order).
Does that sound coherent with what you were explaining in the glossary?
@georges yep sounds mostly right to me! hexagonal is mostly about thinking more clearly about components and less about “layers” (each component can have arbitrary layers, too).
and the diff between injection and locator is literally just the acquisition mechanism with upsides and downsides on both side. it’s explained a bit deeper in https://svcs.hynek.me/en/latest/why.html#is-this-dependency-injection – I should probably transplant some of the text
@hynek thanks, things are now way more clear in my head than they were this morning :)
It also looks like on that topic I should resume reading Architecture Patterns with Python. (And wrap my head around how to use sqlalchemy properly in this context)