Open Marlysson opened 8 years ago
Using a method by composition in Frame object and using by delegation.
class Frame: def __init___(self): self.validator = Hamming("pair") def check(self): return self.validator(self)
frame = Frame("0101") if frame.check(): print("It's valid") else: print("Invalid")
Which choice?
hamming.check(frame) frame.check()
USE OF STRATEGY PATTERN
Using a method by composition in Frame object and using by delegation.
Which choice?
USE OF STRATEGY PATTERN