current position:Home>Today, let's talk about the design of event-driven programs on WeChat HL1434096944 phone 19143201164 - Wikipedia

Today, let's talk about the design of event-driven programs on WeChat HL1434096944 phone 19143201164 - Wikipedia

2022-10-12 08:24:02ccf00991

Event-driven programming is a computer programming model.
The program execution flow of this model is determined by user actions (such as mouse buttons, keyboard button actions) or messages from other programsof.
In contrast to batch programming, the flow of program execution is determined by the programmer.
Batch (batch) programming is a way in the elementary programming teaching course.
However, event-driven programming this design model
is in interactive programming(Interactive program).
Event-driven programs can be implemented in any programming language, however some languages ​​are easier to write than others.
Some Integrated Development Environments (IDEs) can also affect how easy it is to implement an event-driven design.
Some IDEs make development easy, while others don't.
Instead of the traditional way of waiting for a complete instruction and then executing it, the system under the event-driven program model,
The basic architecture is a pre-designed program formed by an event loop that constantly checks the information to be processed at present,
Execute a trigger function to perform necessary processing according to the information to be processed.
Where this external information may come from a file in a directory, may come from a keyboard or mouse action, or a time event.
Programming an event driven system,
soIt can be regarded as an action that rewrites the behavior of the system's default trigger function to meet its own needs.
Input events can be placed into the event loop or interact with hardware events via registered interrupt handlers;
And many software systems use a mix of these two techniques.
Pre-designed algorithms make sure that when they are needed, they will be triggered at the right time.
It also provides an
simulated interrupt driven abstraction architecture.
Event-driven programming basically consists of many small program fragments,
theseApplet fragments are called event handlers and are used to respond to external events and dispatch events.
Events that have not been processed by an event handler are usually placed by the system in a data structure called an event queue, waiting to be processed.
In many cases, event handlers can trigger events themselves, thus possibly forming an event string.
Event-driven programming focuses on flexibility and asynchrony, and tries to be as modeless as possible.
Programs such as graphical user interfaces are typical event-driven designs.
A computer operating system is a typical example of an event-driven program.
At the lowest level of the operating system, the interrupt handler acts like a direct handler for hardware events,
Works with the CPU to execute the assignment event rule action.
For software processes, basically the operating system can be regarded as an event dispatcher, sending data and software interrupts to software processes written by users themselves.

copyright notice
author[ccf00991],Please bring the original link to reprint, thank you.

Random recommended