0
Declined

better class diagram for chain of responsibility pattern

Amir Mohammad 9 Π»Π΅Ρ‚ Π½Π°Π·Π°Π΄ β€’ ΠΎΠ±Π½ΠΎΠ²Π»Π΅Π½ anonymous 9 Π»Π΅Ρ‚ Π½Π°Π·Π°Π΄ β€’ 3

hi everybody

i think the following class diagram would be a better representation of Chain of Responsibility pattern.Image 89

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:


БСрвис ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠΈ ΠΊΠ»ΠΈΠ΅Π½Ρ‚ΠΎΠ² Ρ€Π°Π±ΠΎΡ‚Π°Π΅Ρ‚ Π½Π° ΠΏΠ»Π°Ρ‚Ρ„ΠΎΡ€ΠΌΠ΅ UserEcho