Thanks for all your replies.
I don't know why didn't I think of overloading functions in the first place, maybe I just thought I could do it some more hardcore and more dynamic way. Not sure what was in my head at that time.
And about database being dynamic constructed. Well, I could say yes and no at the same time as I have all the plan set as
UML and i know all the data types, that will be used in the database, but who knows what may happen after some update in the future.
And about fetch and get part.
fetchData function actually picks records from the database passed as an argument, i.e.:
|
ext->fetchData("assignments");
|
would get all the records from
assignments table in the database and place them in a buffer, while
getData should get all the data from the buffer and place it into a corresponding vector of objects.
I just thought that there might be some way of doing this dynamically, without any need to specify a separate
getData method for each different object type.
Even though, it seems more and more like it's just not possible or is just not worth the effort.
If there's some way to do that, I'd be more then delighted to find it out, so all further replies will be much appreciated. And if not then I'll just go for overloading functions.
P.S.: thank you
Disch.