This is your brain when you OD on OOP.
You’re right, this is just not oop AT ALL.
For the correct OOP solution, you would need consider whether this can be thought of as a kind of stateless leaf method, and therefore implement it as an abstract (singleton) factory, but on the other hand, if you’re using a context object with the registry pattern, you should probably do this properly with IoC containers. Of course, if your object graph isn’t too complex or entangled, you could always just do constructor injection but you risk manging your unit tests, so I would go cautiously if I were looking in that direction.
Shouldn’t there be a call to the boolean comparison microservices server in there somewhere? Also, we should consider the possibility that booleans and their operators could be overloaded to do something else entirely. We might need a server farm to handle all of the boolean comparison service requests.
I know. I didn’t say this was OOP, I said this was your brain when you OD on OOP. While we are not dealing with objects, I’d argue that the kind of approach that would lead one to needlessly overcompartmentalise code like this is the product of having a little too much OOP.
Don’t do OOP kids
WTAF? Is this written by a hallucinating AI?
!NOT
Who’s there?
!!Naughty Knots
“You aren’t writing enough lines of code!” - Management