I'm studying design patterns from a course at coursera. They have there course notes in which they define the Subject
of the observer design pattern as super class as shown in the image and code below
Now I think the Subject
class is useless by itself until a subclass inherit from it and make any specific subject. In that case shouldn't the Subject
be a java interface
instead ? What is the reason that the Subject
is not a java interface but the Observer
is.
Is there any specific reason for that. I'm a little confused about this.
Thanks
Aucun commentaire:
Enregistrer un commentaire