1. The concept of event, for example, in what scenarios will event be used?
2. Regarding the concept of monitoring, it is also unclear what application scenarios would be better to use monitoring.
3. The concept of DI (injection), is the service introduced when it is needed? How is it different from ordinary public functions?
PHP中文网2017-06-29 10:10:20
event has many uses, such as processing user login completion (writing login log?), user payment completion processing (issuing payment notification?) and many more.
Listening is the opposite of an event. An event has a listener (that is, the operation performed after the event is triggered (fire)). The event mechanism can be used to decouple the code.
Dependency injection is a big concept. You can search to learn more about it. There are two general benefits:
(1). Decoupling
(2). Convenient for unit testing and mocking