SlideShare a Scribd company logo
1 of 1
Download to read offline
Discuss the benefits of event-driven programming.
Contrast event-driven programming with procedural programming.
Discuss how messages from other programs can be viewed as events.
Give examples. Give examples of tasks that require the program to guide the user.
Should programs be purely event driven, procedural, or a mixture of both? Why?
Solution
The benefit of event-driven programming is that it's very intuitive and naturally well-suited to
applications whose control flow are based, not on its structure, but rather on internal or external
events. This is why event-driven programming is so popular with GUI programming. Likweise,
SOA and client-server architectures are naturally event-driven as well.
We if we find contrast between Procedural and event-based then applications written in
procedural languages execute by proceeding logically through the program code, one line at a
time. Logic flow can be temporarily transferred to other parts of the program through the GoTo,
GoSub, and Call statements, directing the program from beginning to end.
In contrast, program statements in an event-driven application execute only when a specific
event calls a section of code assigned to that event. Events can be triggered by keyboard input,
mouse actions, the operating system, or code in the application. For example, consider what
happens when the user clicks a command button named Command1 on a form. The mouse click
is an event. When the Click event occurs, Visual Basic executes the code in the
Sub procedure named Command1_Click. When the code has finished running, Visual Basic
waits for the next event.
Messages from other programs/threads can be seen as events, as they trigger some instance of
code to execute.

More Related Content

Similar to Discuss the benefits of event-driven programming.Contrast event-dr.pdf

Similar to Discuss the benefits of event-driven programming.Contrast event-dr.pdf (20)

Software Reusability
Software ReusabilitySoftware Reusability
Software Reusability
 
3 Digital Signage and System Software Vs Application Software Important Points
3 Digital Signage and System Software Vs Application Software Important Points3 Digital Signage and System Software Vs Application Software Important Points
3 Digital Signage and System Software Vs Application Software Important Points
 
Software Development Today Everything You Need To Know.pdf
Software Development Today Everything You Need To Know.pdfSoftware Development Today Everything You Need To Know.pdf
Software Development Today Everything You Need To Know.pdf
 
Commonware
CommonwareCommonware
Commonware
 
Software cost estimation
Software cost estimationSoftware cost estimation
Software cost estimation
 
The Evolution from Agile to DevOps
The Evolution from Agile to DevOpsThe Evolution from Agile to DevOps
The Evolution from Agile to DevOps
 
C0371019027
C0371019027C0371019027
C0371019027
 
Unit-1.pptx
Unit-1.pptxUnit-1.pptx
Unit-1.pptx
 
Mvi an architecture for reactive programming
Mvi an architecture for reactive programmingMvi an architecture for reactive programming
Mvi an architecture for reactive programming
 
Cross-Platform App Development
Cross-Platform App DevelopmentCross-Platform App Development
Cross-Platform App Development
 
Programming vs Coding: Unveiling The Key Differences
Programming vs Coding: Unveiling The Key DifferencesProgramming vs Coding: Unveiling The Key Differences
Programming vs Coding: Unveiling The Key Differences
 
Software Lifecycle Management
Software Lifecycle ManagementSoftware Lifecycle Management
Software Lifecycle Management
 
grade 10 2023.pptx
grade 10 2023.pptxgrade 10 2023.pptx
grade 10 2023.pptx
 
Lecture1422914635
Lecture1422914635Lecture1422914635
Lecture1422914635
 
Project Management for Mobile Apps
Project Management for Mobile AppsProject Management for Mobile Apps
Project Management for Mobile Apps
 
main
mainmain
main
 
Introducton of event-driven edited.pptx
Introducton of event-driven edited.pptxIntroducton of event-driven edited.pptx
Introducton of event-driven edited.pptx
 
2018 Pivotal DevOps Day_Pivotal 소개 및 세션 아젠다 소개
2018 Pivotal DevOps Day_Pivotal 소개 및 세션 아젠다 소개2018 Pivotal DevOps Day_Pivotal 소개 및 세션 아젠다 소개
2018 Pivotal DevOps Day_Pivotal 소개 및 세션 아젠다 소개
 
2018 Pivotal DevOps Day_마이크로서비스 전환 방법론과 사례
2018 Pivotal DevOps Day_마이크로서비스 전환 방법론과 사례2018 Pivotal DevOps Day_마이크로서비스 전환 방법론과 사례
2018 Pivotal DevOps Day_마이크로서비스 전환 방법론과 사례
 
Chapter_01.ppt
Chapter_01.pptChapter_01.ppt
Chapter_01.ppt
 

More from arishaenterprises12

In biology, the roles of transition metal ions can be broadly groupe.pdf
In biology, the roles of transition metal ions can be broadly groupe.pdfIn biology, the roles of transition metal ions can be broadly groupe.pdf
In biology, the roles of transition metal ions can be broadly groupe.pdf
arishaenterprises12
 
I need help with this one Question 18 of 18 Sapling Learning macmill.pdf
I need help with this one Question 18 of 18 Sapling Learning macmill.pdfI need help with this one Question 18 of 18 Sapling Learning macmill.pdf
I need help with this one Question 18 of 18 Sapling Learning macmill.pdf
arishaenterprises12
 
Explain how recombination increases the amount of genetic variation i.pdf
Explain how recombination increases the amount of genetic variation i.pdfExplain how recombination increases the amount of genetic variation i.pdf
Explain how recombination increases the amount of genetic variation i.pdf
arishaenterprises12
 
Chapter 7 , book Health in the Later Years, 5th EditionGive a his.pdf
Chapter 7 , book Health in the Later Years, 5th EditionGive a his.pdfChapter 7 , book Health in the Later Years, 5th EditionGive a his.pdf
Chapter 7 , book Health in the Later Years, 5th EditionGive a his.pdf
arishaenterprises12
 
Before 1900, despite its weaknesses in effective management of worke.pdf
Before 1900, despite its weaknesses in effective management of worke.pdfBefore 1900, despite its weaknesses in effective management of worke.pdf
Before 1900, despite its weaknesses in effective management of worke.pdf
arishaenterprises12
 
Alpha particle radiation sensor. A silicon diode radiation sensor is .pdf
Alpha particle radiation sensor. A silicon diode radiation sensor is .pdfAlpha particle radiation sensor. A silicon diode radiation sensor is .pdf
Alpha particle radiation sensor. A silicon diode radiation sensor is .pdf
arishaenterprises12
 
A ship was caught in a storm and driven to a small island in the mid.pdf
A ship was caught in a storm and driven to a small island in the mid.pdfA ship was caught in a storm and driven to a small island in the mid.pdf
A ship was caught in a storm and driven to a small island in the mid.pdf
arishaenterprises12
 
Among 10 people traveling in a group, 2 have outdated passports. It .pdf
Among 10 people traveling in a group, 2 have outdated passports. It .pdfAmong 10 people traveling in a group, 2 have outdated passports. It .pdf
Among 10 people traveling in a group, 2 have outdated passports. It .pdf
arishaenterprises12
 
1.) The normal eye color of Drosophila is red, but strains in which .pdf
1.) The normal eye color of Drosophila is red, but strains in which .pdf1.) The normal eye color of Drosophila is red, but strains in which .pdf
1.) The normal eye color of Drosophila is red, but strains in which .pdf
arishaenterprises12
 
29. Code an application program that keeps track of student informat.pdf
29. Code an application program that keeps track of student informat.pdf29. Code an application program that keeps track of student informat.pdf
29. Code an application program that keeps track of student informat.pdf
arishaenterprises12
 

More from arishaenterprises12 (20)

It was noted that excess water can kill plants. If water is not toxi.pdf
It was noted that excess water can kill plants. If water is not toxi.pdfIt was noted that excess water can kill plants. If water is not toxi.pdf
It was noted that excess water can kill plants. If water is not toxi.pdf
 
In biology, the roles of transition metal ions can be broadly groupe.pdf
In biology, the roles of transition metal ions can be broadly groupe.pdfIn biology, the roles of transition metal ions can be broadly groupe.pdf
In biology, the roles of transition metal ions can be broadly groupe.pdf
 
Image that a researcher examined how the people’s heights are associ.pdf
Image that a researcher examined how the people’s heights are associ.pdfImage that a researcher examined how the people’s heights are associ.pdf
Image that a researcher examined how the people’s heights are associ.pdf
 
I need help with this one Question 18 of 18 Sapling Learning macmill.pdf
I need help with this one Question 18 of 18 Sapling Learning macmill.pdfI need help with this one Question 18 of 18 Sapling Learning macmill.pdf
I need help with this one Question 18 of 18 Sapling Learning macmill.pdf
 
Explain how recombination increases the amount of genetic variation i.pdf
Explain how recombination increases the amount of genetic variation i.pdfExplain how recombination increases the amount of genetic variation i.pdf
Explain how recombination increases the amount of genetic variation i.pdf
 
exclange I ren peretr) ol and eleaced by the maxtit wadr Ho t Col pox.pdf
exclange I ren peretr) ol and eleaced by the maxtit wadr Ho t Col pox.pdfexclange I ren peretr) ol and eleaced by the maxtit wadr Ho t Col pox.pdf
exclange I ren peretr) ol and eleaced by the maxtit wadr Ho t Col pox.pdf
 
DNA is a macromolecule that is critical for life. Much of the functi.pdf
DNA is a macromolecule that is critical for life. Much of the functi.pdfDNA is a macromolecule that is critical for life. Much of the functi.pdf
DNA is a macromolecule that is critical for life. Much of the functi.pdf
 
Chapter 7 , book Health in the Later Years, 5th EditionGive a his.pdf
Chapter 7 , book Health in the Later Years, 5th EditionGive a his.pdfChapter 7 , book Health in the Later Years, 5th EditionGive a his.pdf
Chapter 7 , book Health in the Later Years, 5th EditionGive a his.pdf
 
Before 1900, despite its weaknesses in effective management of worke.pdf
Before 1900, despite its weaknesses in effective management of worke.pdfBefore 1900, despite its weaknesses in effective management of worke.pdf
Before 1900, despite its weaknesses in effective management of worke.pdf
 
Alpha particle radiation sensor. A silicon diode radiation sensor is .pdf
Alpha particle radiation sensor. A silicon diode radiation sensor is .pdfAlpha particle radiation sensor. A silicon diode radiation sensor is .pdf
Alpha particle radiation sensor. A silicon diode radiation sensor is .pdf
 
A ship was caught in a storm and driven to a small island in the mid.pdf
A ship was caught in a storm and driven to a small island in the mid.pdfA ship was caught in a storm and driven to a small island in the mid.pdf
A ship was caught in a storm and driven to a small island in the mid.pdf
 
8. List 4 GENERAL ways that a CELL, can DECREASE the rate of its rea.pdf
8. List 4 GENERAL ways that a CELL, can DECREASE the rate of its rea.pdf8. List 4 GENERAL ways that a CELL, can DECREASE the rate of its rea.pdf
8. List 4 GENERAL ways that a CELL, can DECREASE the rate of its rea.pdf
 
As leaf temperature increases from 20°C to 35°C, the quantum yield o.pdf
As leaf temperature increases from 20°C to 35°C, the quantum yield o.pdfAs leaf temperature increases from 20°C to 35°C, the quantum yield o.pdf
As leaf temperature increases from 20°C to 35°C, the quantum yield o.pdf
 
Among 10 people traveling in a group, 2 have outdated passports. It .pdf
Among 10 people traveling in a group, 2 have outdated passports. It .pdfAmong 10 people traveling in a group, 2 have outdated passports. It .pdf
Among 10 people traveling in a group, 2 have outdated passports. It .pdf
 
1.) The normal eye color of Drosophila is red, but strains in which .pdf
1.) The normal eye color of Drosophila is red, but strains in which .pdf1.) The normal eye color of Drosophila is red, but strains in which .pdf
1.) The normal eye color of Drosophila is red, but strains in which .pdf
 
29. Code an application program that keeps track of student informat.pdf
29. Code an application program that keeps track of student informat.pdf29. Code an application program that keeps track of student informat.pdf
29. Code an application program that keeps track of student informat.pdf
 
Write the code for a small function called myStack, which creates a .pdf
Write the code for a small function called myStack, which creates a .pdfWrite the code for a small function called myStack, which creates a .pdf
Write the code for a small function called myStack, which creates a .pdf
 
Why does the neutralization of an acid by a base often produce water.pdf
Why does the neutralization of an acid by a base often produce water.pdfWhy does the neutralization of an acid by a base often produce water.pdf
Why does the neutralization of an acid by a base often produce water.pdf
 
Which statement about phloem transport is falseIt takes place in .pdf
Which statement about phloem transport is falseIt takes place in .pdfWhich statement about phloem transport is falseIt takes place in .pdf
Which statement about phloem transport is falseIt takes place in .pdf
 
Which of the following is not a primitive data type Which of th.pdf
Which of the following is not a primitive data type Which of th.pdfWhich of the following is not a primitive data type Which of th.pdf
Which of the following is not a primitive data type Which of th.pdf
 

Recently uploaded

Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 

Recently uploaded (20)

Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptx
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 

Discuss the benefits of event-driven programming.Contrast event-dr.pdf

  • 1. Discuss the benefits of event-driven programming. Contrast event-driven programming with procedural programming. Discuss how messages from other programs can be viewed as events. Give examples. Give examples of tasks that require the program to guide the user. Should programs be purely event driven, procedural, or a mixture of both? Why? Solution The benefit of event-driven programming is that it's very intuitive and naturally well-suited to applications whose control flow are based, not on its structure, but rather on internal or external events. This is why event-driven programming is so popular with GUI programming. Likweise, SOA and client-server architectures are naturally event-driven as well. We if we find contrast between Procedural and event-based then applications written in procedural languages execute by proceeding logically through the program code, one line at a time. Logic flow can be temporarily transferred to other parts of the program through the GoTo, GoSub, and Call statements, directing the program from beginning to end. In contrast, program statements in an event-driven application execute only when a specific event calls a section of code assigned to that event. Events can be triggered by keyboard input, mouse actions, the operating system, or code in the application. For example, consider what happens when the user clicks a command button named Command1 on a form. The mouse click is an event. When the Click event occurs, Visual Basic executes the code in the Sub procedure named Command1_Click. When the code has finished running, Visual Basic waits for the next event. Messages from other programs/threads can be seen as events, as they trigger some instance of code to execute.