I find it difficult to make a design decision
I have a python class that processes form data, this data is very similar to other form data, and so I will reorganize it into my own object so that it can be reused by other classes.
delima is the weather to make this formprocessor a member of classes or parent classes.
please correct me if this terminology is incorrect, here is what I am torn between:
classes based on monolithic inheritance:
class FormProcessor(object):
def post(self):
class PageHandler(RequestHandler,FormProcessor):
def get(self):
or more modular element-based classes:
class FormProcessor(object):
def process(self):
class PageHandler(RequestHandler):
def __init__(self):
self.processor = FormProcessor()
def get(self):
def post(self):
self.processor.process(self.postdata)
, , . , , , , , PageHandler, -, .
, , , , , , .