lundi 8 mai 2017

Uniform Database Reader

I want DatabaseReader that is compatible for multiple databases. It will be Factory (design pattern). You select your preferred database (mysql, postgresql or other) and after that you can request data from it.

>> My UML design <<

enter image description here

Notes:

  1. I will program this in C++ so multiple Base classes are possible
  2. It is on purpose that the queries are pre-defined in a abstract/ pure virtual class so I can make for each derivative of Database a own implementation.
  3. I'am also aware that by the predefined queries the content of the database must already be clear, sinces I'am putting the query static in the getData()-function.

My Question:

What do you guys think? I think my design can be easier but no sure how. (Maybe) there are design patterns for this kind of "problems" ?

Thanks for your attention.

Aucun commentaire:

Enregistrer un commentaire