Hi to all, i've a problem:
what is the right way for making a class, if the values of it's propertys
can be loaded/stored from a database not object oriented, like MySQL?
I'm trying to write a little application in order to make practice:
the application is an archive of cars.
I've created a class (class D😎 that connect to a database and have methods
like update, read etc.
Now i've to make the class Car. When an user would like to insert a new car,
i will make a new object
of type Car, and fill it's propertys with methods like setModel.
But how i save the object to the database?
I've to make a second class CarDB, that inherit from Car, and that add the
method
save() and load() ?
I've to make the class Car to use an external object DB for save/load from
database?
I've to make an object container of tipe Car (like a vector) that has
methods
for create Car objects, load and save to db?
If yes, this container should inherit from DB, or use it (for example
reciving a pointer
to an object DB in it's constructor?)
Please help me..
Happy new year!
Luca