0
Declined

better class diagram for chain of responsibility pattern

Amir Mohammad 5 months ago • updated by Alexander Shvets 3 months ago 3
hi everybody
i think the following class diagram would be a better representation of Chain of Responsibility pattern.
Under review

Hi! Why do you think it's better?

Hi


You should replace:


    nextHandler.handle();

by


    if (isDefined(nextHandler))
        nextHandler.handle();
Declined

I'm closing this for now, because it seems that current illustration does contain simple "isDefined" and "canHandle" checks: