jeudi 10 mars 2016

Table specific queries vs one single generic query

I have a DB with various tables. I see myself writing various function of this form :

def getAgeAndHealthFromUser()
def getIDPriceLifeFromProduct()
def getIDFromUser()
def getPriceFromProduct()
def setIDFromUser()
def setPriceFromProduct()

.. and so on.

Basically I am selecting / setting multiple columns of different tables most of the time. I hope you get it.

That is when I tried the generic function approach which takes different column names, table name as input and does the work.

I want to know does this approach has any potential problems I might get into ? Is this the right thing to do design wise ?

Aucun commentaire:

Enregistrer un commentaire