Your comments

That's a nickname for the Observer pattern.

Thanks for your feedback, Eloi!


These are pretty huge concepts to be explained within a single book. If such book was a thing, it would contain over 1000+ pages. So, unfortunately, the answer is no.

Thanks for your kind words!

Thanks for your feedback, Vinayak!

Hey Pablo,

Sorry, out books has not been published as hard copies yet. Currently, there are only ebooks available for purchase.

Hello again, Abelardo.

It mostly makes sense if your code has a lot of conditionals that check whether an object is null and perform some action if so. This "default" behavior usually fits well inside a null object.

Hi, Abelardo!

The reason why they both get the getAnnualCost method is because you'd want to unify their interfaces.

To achieve that, you'll need to rename the Department's method, but leave the Employe's method intact. If both of these methods had similar implementation, you could pull them to the base class and get rid of the method in subclasses altogether (like with getName).

But here we just assume that that wasn't possible and there are still some need for the overriding. Again, it can play out in different ways in real life.

Hope this makes sense.