Push, pull mechanism observer pattern

前端 未结 3 622
名媛妹妹
名媛妹妹 2020-12-29 16:12

At the moment I\'m studying design patterns and I\'ve come to a part where I\'m confused whether the observer pattern makes use of the push mechanism or does it make use of

3条回答
  •  死守一世寂寞
    2020-12-29 16:35

    The observer pattern uses push since the observable object push notifications to its subscribers.

    Push vs Pull (in web mostly): Push - the server sends(push) notifications to clients, this means it needs keep tracking on their address (URI) or in the more general case their reference.

    Pull - the client is responsible for requesting fresh data from the server.

    The pattern is not only for Web and is used all over, for example in desktop applications.

提交回复
热议问题