'''
Sometimes an object comes in many types or forms.
 If we have a button, there are many different draw
outputs (round button, check button, square button, button with image)
but they do share the same logic: onClick().  We access them using the same method .
 This idea is called Polymorphism.
'''

'''
abstract class Browser which holds the structure  start() and stop().
https://pythonspot.com/en/polymorphism/
'''

class Browser:
    def __init__(self,name):
        self.name=name
        print "Browser name",name

    def start(self):
        print "Starting .."
        raise NotImplementedError("Subclass must implement abstract method")

    def stop(self):
        print "Stopped"
        raise NotImplementedError("Subclass must implement abstract method")


class Firefox(Browser):
    def start(self):
        print "Execution started on Firefox browser"

    def stop(self):
        print "Execution stopped on Firefox browser"


class Chrome(Browser):
    def start(self):
        print "Execution started on Chrome browser"

    def stop(self):
        print "Execution stopped on Chrome browser"

if __name__ == '__main__':
    firefox = Firefox('Firefox')
    firefox.start()

    print "----------------------"

    chrome = Chrome('Chrome')
    chrome.start()
