Then in your class schema, you could follow the Strategy Pattern. in this case you build an abstract class called let's say DBObject ( DataBase's Object ), where every Object that has an instance in your Database is a DBObject ( Users, Topics, Commends etc ).