Sample Code:
class PlayButton < Button
def initialize
super(“Play”) # invoke Button’s initialize process
end
def buttonSelected
# do something that should be done when the start button is pressed
end
end
bPlay = PlayButton.new
This type of approach would bring about two very problematic scenarios; one, the actions that are to be done when a button is selected and pressed is not a function of the button itself but of the overall device which has the buttons as interface; and last, this would have us making tons of buttons that would correspond to all the function the overall device that if the said button’s features or process were to change that would create a ton of maintenance issues in efforts to re-define those buttons to do all the different functions buttons should do in the whole application/device.
