Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

2
  • You seem to be assuming that you still need a master DataBase class even after the split, why not have dogdb.someMethod(); catdb.otherMethod(); instead of one db object for both? Also, are you sure all your SQL operations will affect only one table at a time? (most properly-normalized databases require join queries to do anything interesting) Commented Apr 18, 2015 at 19:41
  • In the main class. I have one object DB and this object call the methods. My database I have 3 tables (room (id,name), pets(id, room_id, name), friend(id, animal_id, name)). So first I select a room and now I can now how many animals we have in that room, so if I want know the owner of one animal I can do it. But I only want have DB on the main application for all the program, because in the constructor I create the database and I make the connection and I handle all the request. But I want split the class for one for each table for more readable code and more easy implement more methods Commented Apr 18, 2015 at 19:52