So I am writing a datamodel in python that interacts with an python module that queries the api.
class QueryAPI():
def __init__(self, clientid, clientsecret):
self.clientid = clientid
self.clientsecret = clientsecret
def create_user_info(self, name, address):
......
class MyModel(object):
def __init__(self, name, address);
self.name = name
self.address = address
def commit():
create_user_info(name, address)
and this api has lot more functions that will be used by my other datamodels. Right now, I am wondering where should I instantiate this QueryAPI object. Does it make sense to have a base class that instantiate it and have all my data models access it from there?
Does it make sense to have a base class that instantiate it and have all my data models access it from there?-- That depends on whether or not you need the features and functionality that a base class provides.