DEV Community

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

serhuz profile image
Sergei Munovarov

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.

Thread Thread
seanballais profile image
Sean Francis N. Ballais Author

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