• Python design pattern – behavioral: strategy pattern, observer pattern, command pattern, template method


    Python design pattern – behavioral: strategy pattern, observer pattern, command pattern, template method Behavioral patterns involve the assignment of responsibilities between algorithms and objects. They not only describe the patterns of objects or classes, but also describe the communication methods between them. They depict complex control flows that are difficult to track at runtime. They […]

  • [react advanced] [Redux source code analysis] 01 (Introduction) realize Redux data response through simple native JS code


    To break up the source code, let’s analyze it bit by bit from the observer mode Concretely, the most common example is that we usually subscribe to a official account, right? After you subscribe to a official account, when the official account you subscribe to publishes any notices or tweets, you will receive them. As […]

  • Implementation of small red dot system based on livedata


    preface The little red dot prompt can be said to be a function that all apps now have, such as the message interface of wechat and the my interface of Weibo. Generally speaking, a small red dot will not exist alone, but may be associated with other red dots to form a red dot system. […]

  • Observer mode in design mode


    Observer pattern is a software design pattern in which an object named subject maintains its dependency list, called observers, and usually automatically notifies them of any state changes by calling one of their (observers) methods. Observer mode is mainly used to implement distributed event processing system in “event driven” software. In these systems, the subject […]

  • Intermediary model of design pattern


    The intermediary model, also known as the mediator model, is a behavioral model; The mediator pattern wraps a set of ways in which objects interact so that they do not have to explicitly reference each other. So that they can be loosely coupled. When the interaction between some of these objects changes, it will not […]

  • Zookeeper of big data


    data model The zookeeper data model is a tree like data structure, similar to the file system; The difference from the file system is that each node in the tree (leaf node and non leaf node) can save data, and the access of each node must start from the root node, with a slash as […]

  • Web GL enters the three-dimensional world


    Three dimensional objects are composed of triangles, so we need to draw each triangle of the object one by one as before, and finally draw the whole three-dimensional object, but there is a significant difference between three-dimensional and two-dimensional. When drawing two-dimensional objects, we only need to consider X and Y information, but when drawing […]

  • Behavior type: I Observer mode


    What is the observer mode Observer pattern is a behavior design pattern that allows one object to notify other objects of changes in its state. Observer mode allows you to define a subscription mechanism that can notify multiple observers when an object event occurs. Why use observer mode When the state of one object changes […]

  • MySQL — on the use and understanding of triggers


    This article introduces triggers in three steps: 1. What is a trigger 2. Create trigger 3. Use trigger   1. What is a trigger? A special kind of database program that can monitor the operation of certain data (insert / update / delete) and trigger relevant operations (insert / update / delete) to protect the […]

  • Paoding jieniu talks about entrustment, which are hidden by the compiler and given by U3D (Part 1)


    0x01 start with observer mode Among design patterns, there is a design pattern we often use – observer pattern. So what does this design pattern have to do with our theme “how to use delegation in unity3d”? Don’t worry. Let’s talk about observer mode first. First, let’s take a look at the subscription of newspapers […]

  • Rxjava (II)


    1、 Observer mode 1.1. Traditional observer model 1.2 observer mode of rxjava differenceThe traditional observer mode is one observable and multiple observers. The observer mode of rxjava is multiple observable and one observer. 2、 Subscription process Let’s take this simple code as an example: Observable.create(new ObservableOnSubscribe<Integer>() { @Override public void subscribe(@NonNull ObservableEmitter<Integer> emitter) throws Exception […]

  • Application of laravel model event


    When dealing with some user operation events, we sometimes need to record them for future reference or big data statistics. Laravel is easy to handle in model events:https://laravel-china.org/docs/laravel/5.5/eloquent#events There are two ways for laravel’s model events, set updispatchesEventsProperty mapping event class Use the observer to register events. Here is the second method New model php […]