sample python implementation example description typical example of mediator pattern can be manifested in test automation framework which consists of four classes namelytc (testcategory)testmanagerreporter and db(database class tc is responsible for running the tests with the help of setup()execute(and teardown(methods class reporter calls its prepare(method while the test category starts getting executed and calls its report(method when the test category finishes its execution this helps in text based reporting of the tests that are run by the framework class db stores the execution status of the test category by first calling the insert(method while the test category is in setup()and then calls the update(method once the test category has finished execution in this wayat any given point of timethe test execution status is available for framework user to query from the database testmanager class is the one that co-ordinates for test category execution (class tcand fetching the reports (class reporterand getting the test execution status in database (class dbwith the help of preparereporting(and publishreport(methods methods settm()settc()setreporter(and setdb(are used so that the classes could register with each other and can communicate easily building the analogy with the mediator patternthe testmanager class is mediator between class tcclass reporter and class dbthe colleagues in the system let' have look at sample python code which would make the concept more clear python code import time class tcdef __init__(self)self _tm tm self _bproblem def setup(self)print "setting up the test www testingperspective com