example for strategy pattern & example for observer pattern