https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41892 --- Comment #10 from David Cook <dcook@prosentient.com.au> --- (In reply to Tomás Cohen Arazi (tcohen) from comment #8)
(In reply to David Cook from comment #6)
I reckon creating a Koha::Context singleton would likely bloat over time and just get us back to where we are now.
The hard part when we have 1 object doing many things is that it ends up having many dependencies which then leads to circular dependencies.
The whole point of introducing object orientation here is that consumers will get an object and will no longer need to import anything. They'll have a factory class that we control circ deps at, and provides the instantiated classes.
Except that by loading the factory class they'll have to load the dependencies of the factory class too, so they'll still be running the import() method on those dependencies. Depending on what you have in mind, you could move those "require <class>" into methods instead of using "use <class>" at the top, but that just disguises the dependencies and makes them harder to find. You could add a few more layers of abstraction on top of what Jonathan has done, but I don't think it would add any value. But happy to see a POC. Maybe I'm misunderstanding what you're saying. -- You are receiving this mail because: You are watching all bug changes.