should the Observer Pattern include some infinite loop detection?

后端 未结 6 1981
我在风中等你
我在风中等你 2021-01-03 09:23

Quickly going through the GoF and the Head First Design Patterns book, it seems like there is no mentioning of infinite loop detection and handling for the Observer pattern?

6条回答
  •  甜味超标
    2021-01-03 09:49

    It is kinda weird that people with high rating give such a useless answers. sigh

    Event loops happen and happen VERY often in GUI programming. It seems to me that more or less standard solution is to break the loops by either filtering duplicate or redundant events or introduce some method that do not trigger events.

提交回复
热议问题