Composition instead of inheritance for PostgresJobStore #142
Labels
Issue appropriate for: People up for a challenge 🤯
This issue probably will be challenging to tackle
Issue contains: Exploration & Design decisions 🧩
We don't know how this will be implemented yet
Issue contains: Some documentation 📚
This issues involves writing some documentation
Issue contains: Some Python 🐍
This issue involves writing some Python code
We're dealing with fine software design issues, it's really no big deal if we don't go this way.
I think we could make a last (haha, last...) modification on how our job store handles being plugged with a real
Postgres
database versus being in memory for tests and such . Today, it's done via inheritance, with aBaseJobStore
, aPostgresJobStore
and anImMemoryJobStore
. I've finally realized that it would be much cleaner in terms of separation of concerns if the whole idea of store was uncorrelated from the idea of DB connection. We could have aJobStore
, and aPostgresConnector
and anInMemoryConnector
, and theJobStore
would receive an...Connector
instance at creation time (same way as the App currently receives a Job Store instance).That would mean the App would be given a connector instead of a
JobStore
. If we change the name, that would be backwards incompatible, but we could still keep the namePostgresJobStore
as an alias ofPostgresConnector
for at least a few releases.The text was updated successfully, but these errors were encountered: