I have just started reading the book, and in the Strategy pattern they discouraged the use of interface to enforce an implementation of a method.
However, upon the next chapter: Observer Pattern, they did just that. Wherein, they used a Display interface with a display method to be implemented by the concrete observers.
My question is: in the end is it really okay to use interfaces like that? If not, is there a better method on how to do this?
Aucun commentaire:
Enregistrer un commentaire