[Solved] Does this class violate SOLID’s single responsibility principle? [closed]

As your class above has atleast two responsibilities i.e. creating a database connection and performing CRUD operations on the entities, so I think it violates the SOLID’s single responsibility principle. You might create a seperate class to deal with the Database connection and register it as a dependency (through an interface) to the Database class … Read more