Event-Driven Programming
Event-Driven Programming
applications.
Event-driven programming refers to a programming model of
computers, where events that occur are used for determining the flow
of a program control.
Event dependency
The flow of the program is determined by events that can be actions of the user,
messages from other programs, etc., separating the logic of event processing
from the rest of the program's code, thus contrasting with batch processing.
Service-oriented
It is used to write programs designed for service without slowing down the
computer, since the service-oriented approach only consumes a little power
processing. In addition, services generally run in the background of
operating system.
Events
It is a condition that arises during the execution of a program and that requires some
action by the system. Each event is different by nature, some require
that the program recovers and displays certain information, and others that are initiated
calculations and changes of state.
The events include the mouse, the keyboard, a user interface, and the actions that are
must activate in the program when they occur. This means that the user must
interact with an object in the program, such as clicking a mouse button, use
the keyboard to select a button, etc.
Event controller
It is a specific unit of the program that is activated to respond to an event.
That is to say, it is a type of function or method that performs a specific action when it
activate a certain event.
For example, it could be a button that when the user clicks on it shows a
message and when I click that button again, close the message.
Activation functions
They are functions that decide which code to execute when a specific event occurs.
They are used to select which event handler to use when an event occurs.
Controlled time
It is a specific code that runs at a certain time. This means that
it is a predefined task to be done.
Work permit
A practical example of an event used in event-driven programming
could be an employee requesting a work permit in a system. When this
the employee submits their application, it will trigger a notification that will be sent to the manager to
that it be approved.
The manager could see the details of the request, approve it or reject it, updating itself.
in the system without the need to log in again.
Start of actions
The actions of a program that follows the principles of object-oriented programming
events are initiated by events:
Scheduled.
Runtime.
When an event occurs, the planner must determine the type of event and
select an appropriate event handler, or handle the event if one does not exist
appropriate event handler.