bobstar

bobstar

  • NA
  • 4
  • 0

A simple class question

Jun 1 2004 5:27 PM
Hello... Im a little new in all this OOP, lets say i've a class handling all database write and reads - lets call it for the DB-class. And I've another class which is collecting user input - lets call this for the input class just for simplicity. Now i need to store all the user input into the db, should I write methods in the db-class to handle an object from the imput class or should i write another class which inherits from the db class and write code to handle the input objects. Or as my last suggestion, should I write methods in my input class and just get some different info from the db-class to connect and write and so on. The last suggestion would make it possible to remove all traces of my input class if for some reason i needed to get rid of it. But im not sure thats the point in OOP? or have i missed something? If anybody would be so kind eventually to write pseudo code to get my mind going I would be happy :O) - Or just explain it for a newbie. Kind regards

Answers (2)