Skip to content
loading...

re: I need help refactoring the database module where all the creation, insertion, etc. code are in their own respective files. VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Why? Singletons tend to be misused so my warning flag goes up. Add some unit/integration tests instead. Given tests will be implemented properl...
 

Singletons tend to be misused so my warning flag goes up.

Singleton is just a way to ensure that only one instance of some class is present at runtime. If the project you're working on has DI set up, then you probably can get rid of them without much trouble.

Since there is a text file with queries, maybe try JDBI. It's not exactly an ORM, but from the SQL code you posted I've got an impression that you may do fine without one.

I do am considering JDBI and utilize the data access object pattern. Thanks!

code of conduct - report abuse