Procedural, Event Driven and
Object Oriented
Explanation, relation and example.
Procedural.
• Procedural programming is a method of the
programming which has a support of splitting the
functionalities into a number of procedures. In
procedural programming, a large program is broken
down into smaller manageable parts called procedures
or functions. Here, priority is given on functions rather
than data.
Properties of the procedural
programming.
• Predefined functions.
• Local variables.
• Global variables.
• Parameter passing.
• Modularity.
• Procedures.
• Programming libraries, etc.
Event Driven.
• Event-driven programming is a method of
programming in which the flow of the program is
determined by events such as user actions, sensor
outputs, or messages from other programs/threads.
Properties of the Event driven
programming.
• Service orientated.
• Time driven.
• Event handlers.
• Trigger functions.
• Events like mouse input.
• Predefined functions.
• Local and global variables.
• Parameter passing, etc.
Object Oriented
• The Object-Oriented is a method of programming
based on the objects, aside from just procedures and
functions. These objects are planned into classes, which
are allowing to the individual objects to be group
together.
Properties of the object oriented
programming.
• Encapsulation
• Data Abstraction
• Inheritance
• Polymorphism
• Extensibility
• Persistence
• Delegation
• Generality, etc.
Relation between all the three
programming paradigms.
• Both the OOP and the EDP share a lot of common feature, like calling
some method when some event is registered.
• All the programming paradigms share the common feature of the
local and global variable.
• Where procedural programming allows access to variables from about
anywhere, which in turn makes the debugging very difficult, OOP and
EDP restricts the access to variables.
• Both OOP and EDP have event driven functions.
• All have extensive predefined libraries.
Example code for each paradigm.
• In Pascal (Procedural programming).
program HelloWorld(output);
begin
Write(“Hello Wolrd!”);
end
• In java (EDP & OOP)
Class Hello_world {
public static void main(String[] args){
System.out.println(“Hello world!”);
}
}
• From the example Above, we can clearly see, that procedural executes instructions line by
line.
• From the example Above, we can see that most of the modern programming languages
already has the event driven architecture built into them. In theory, most of the modern
languages support the ED architecture.