chain of responsibility pattern here is simple implementation of the chain of responsibility patternwith all of the extras stripped away all that is left is the general structure that we will be implementing on our web app class endhandler(object)def __init__(self)pass def handle_request(selfrequest)pass class handler (object)def __init__(self)self next_handler endhandler(def handle_request(selfrequest)self next_handler handle_request(requestdef main(request)concrete_handler handler (concrete_handler handle_request(requestif __name__ ="__main__"from the command line we can define some request main(requestwe will now use this very minimal skeleton to significantly improve our web app from the beginning of this the new solution will adhere to the single responsibility principle much more closely you will also note that you could add many more functions and extensions to the process import base class user(object)def __init__(selfusernamepasswordnameemail)self username username self password password