Event-driven programming refers to the programming technique where the flow of the program is driven by recognition and handling of events such as mouse clicks, key presses, etc.

learn more… | top users | synonyms

0
votes
0answers
9 views

Hidden event handlers and their parameters

I'm having a bit of trouble understanding why has an event handler to be defined as a function. AFAIK, a function can be used as anonymous called procedure as event handler It defines a ...
-3
votes
0answers
23 views

Problem referencing resources [closed]

I'm still a newbie to android programming, so I tried a tutorial that was to create a music app, at a stage of the tutorial I was asked to create a new class that extends BaseAdapter and at a point in ...
-2
votes
0answers
81 views

Checkedlist box select multiple checkboxes values insert to database [closed]

I am new to working on vb.net 2008, want to know how to insert multiple selected checkboxes value from checkedlistbox in vb.net 2008 to sql server 2005 database. so I have two table in which fields ...
0
votes
1answer
43 views

Software to access GSM Terminal, sending and receiving AT commands, validating results

I am currently implementing a software that uses a GSM terminal to perform actions. Actions can be sending messages, checking balance, receiving status report messages, setting the pin, ... The ...
-1
votes
1answer
33 views

How do Event Bus and ReativeX interact with each other?

I wanted to look into communication/decoupling patterns and how to improve them. My current approach is to have a centralized commander in the form of an Event Bus and make him be the one to respond ...
2
votes
1answer
87 views

Do I need EventAggregator here?

I'm learning MVVM pattern with C#, WPF and .NET Framework 4.5.1. I'm using MVVM Light framework to do it and now I have a doubt. Reading the book Windows 8 MVVM Patterns Revealed I see that the ...
1
vote
1answer
122 views

Pass Event between Systems in a multi-threaded Entity-Component-System

Is there a way to pass Events between Systems in a multi-threaded Entity-Component-System that realizes the benefits of saving on system resources? I've read a german article about the ...
0
votes
3answers
90 views

Are EventHandler<T> and IObservable<T> interchangable?

I have an object which will periodically raise an event based on an action performed in an application. This will be heard by any listener(s) and acted upon accordingly. I do not wish to use a ...
0
votes
2answers
81 views

Separate methods or single method with if statement?

I'm working on a .NET application and I'm wondering if I should use separate methods to handle the click events of two different buttons. They essentially do the same thing, just on different objects ...
-1
votes
2answers
81 views

Deeper understanding of event loops and timers [closed]

I have a basic grasp of accepting clients without creating a thread for each connection using tools such as select and modern equivalents (kqueue, epoll). But where do I go from here? e.g async I/O ...
4
votes
1answer
87 views

Is it better to put an event on the top object or closer to where it's local?

Take the following basic structured code for example: class Player { public QuestLog QuestLog { get; set; } } Let us consider that "QuestLog" has the ability to fire off some events when things ...
0
votes
1answer
89 views

Pattern that prevents events to trigger themselves

I am working at the client-side part of a web application, that is responsible for getting answers from users for specific questions and storing and restoring them from the database (or cookies) and I ...
1
vote
0answers
32 views

Multiple handlers of an exception, and handling exceptions in the UI

Related to: Is onError handler better than exceptions? Premise I am writing a piece of library code that performs certain tasks, to separate concerns, we decided it should not write to a log or ...
0
votes
0answers
347 views

Updating GUI in 'realtime' using events

My Plan Have a system that holds some objects Have a winforms-form that displays some key values of these objects When certain changes occur(object gets add / removed / datat change): Update GUI ...
0
votes
0answers
39 views

Is there just one EventHandler class per application?

In a game I'm making I was about to add a MovementEventHandler, with events like "pre-character-movement" and "post-character-movement". But this class will do exactly the same as a future ...
1
vote
1answer
136 views

Should I omit the parameter “e” when using EventHandler<EventArgs>?

Whenever I am defining my own events, I use a pattern such as the following (which I believe is how the MSDN recommends doing it): public class MyEventClass { private bool _value; // Backing ...
2
votes
3answers
302 views

jQuery - When to Bind Event Listeners?

I'm building a medium-sized "single-page" JavaScript application using jQuery. If you include all possible functionality of the application, there are 134 click bindings. Since most of the content is ...
17
votes
4answers
602 views

What should plugins use: hooks, events or something else?

Consider an app that allows plugins to react to its program flow. I know 2 ways to achieve this: hooks and events 1. Hooks Use calls to empty functions inside the main program flow. These functions ...
1
vote
1answer
173 views

Good pattern(s) for pointing to mutable state

I asked this question once here, but believe the question was unclear. However I'm having a hard time extracting the general problem from my specific case. UPDATE: I've answered my own question ...
1
vote
0answers
128 views

State Pattern Code for embedded device - Dependency Injection of Device Objects in Context and State Classes

I'm wrestling with some code and I think I've finally gotten some state pattern code working with my events. I've got a simplified system that will work like this: This is my first go with State ...
0
votes
3answers
78 views

One Event Sent to Multiple Listeners, Want to Log Notification Once

I have a system in place where a Cache is made up of many Cache Nodes. When one is added, a CacheNodeAdded event is raised by the Cache. The Cache has a redundant set of Monitors listening for ...
3
votes
1answer
199 views

Should Libraries Use Events or a Set Action

I'm building a small reusable library for two systems our company manages. Something that I've been caught up on is whether I should expose a set of properties of type Action<T> for events such ...
4
votes
2answers
247 views

How is the publish-subscribe pattern different from gotos?

My understanding is that Goto statements are generally frowned up. But the publish-subscribe pattern seems to be conceptually similar in that when a piece of code publishes a message, it performs a ...
0
votes
1answer
556 views

How does jQuery's mechanism of event handlers work

I'm in the need of widen my perspective on the framework libraries, to be able to make well aware choices of if/which/when to add a framework to a website. One thing that got my attention was event ...
0
votes
3answers
212 views

When/Where to create/assign event handlers to its elements

Lets say I have the following code // JS $(function(){ $('[data-mc=logout]').click(function(){ if (!confirm(myconfig.msg['asklogout'])) { return false; ...
1
vote
1answer
468 views

Global vs Individual object event handlers

Lately I've been studying a lot of javascript samples, both with/without libraries, jQuery to mention one. As an old JavaScript developer, I learned early to make use of unobtrusive javascript where ...
0
votes
1answer
662 views

Event Driven Programming?

I have been looking into event driven programming in C and the language doesn't seem to have support for it. This has led me to wonder about the nature of event driven programming. Is it correct to ...
0
votes
1answer
369 views

sqlite trigger or application event?

I've have two event queues(table mapped queues) based on two different states of same data stored in two different tables. The events are generated on create/update/delete on both the tables. ...
2
votes
3answers
813 views

Difference between event loop and system calls/interrupts

When you create programs (like a socket server) that are designed to run on an operating system, such as Ubuntu, frameworks like Qt for C++ use something called a main event loop: app = new ...
2
votes
2answers
131 views

Distribution of Event Listeners in a Distributed Service Oriented Architecture

I have a service architecture composed of services that service common areas of the application. Examples of services would be: AccountService (manages client accounts in the system) BillingService ...
20
votes
1answer
6k views

Communication between nested directives

There seem to be quite a few ways of communicating between directives. Say you have nested directives, where the inner directives must communicate something to the outer (e.g. it's been chosen by the ...
3
votes
2answers
106 views

Attaching Events to Document Better Than Attaching Them to Elements?

While bouncing around StackOverflow, I've noticed a number of people attaching events (notably click events) to the document as opposed to the elements themselves. Example: Given this: <button ...
19
votes
6answers
2k views

Is an event loop just a for/while loop with optimized polling?

I'm trying to understand what an event loop is. Often the explanation is that in the event loop, you do something until you're notified that an event occurred. You than handle the event and continue ...
0
votes
3answers
154 views

Is it okay to call functions when event occurs, or after that?

So I was not sure how to structure this title, feel free to edit it. My question is: When I have a Game Loop, I have 3 main blocks. Handle Events, Update game state, and draw. Let's say for example I ...
1
vote
1answer
161 views

How to cross-reference many character encodings with ASCII OR UTFx?

I'm working with a binary structure, the goal of which is to index the significance of specific bits for any character encoding so that we may trigger events while doing specific checks against the ...
0
votes
1answer
249 views

How QT Framework handles Events Coming from OS?

When we call QApplication::exec() at the end of our main() function, the application enters Qt's event loop. Conceptually, the event loop looks like this: while (!exit_was_called) { while ...
-6
votes
5answers
1k views

Can PHP handle mouse events? [closed]

I'm a newbie in php and i want to know if php can handle mouse events such as upon mouseCicked, mouseDoubleClicked, mouseMoved, mouseHovered etc.. And can events like button click , like displaying ...
1
vote
2answers
259 views

Am I doing events right?

My problem is with JavaScript in the browser but I guess it could apply to any event-driven environment. I have coded up a widget in my app. The widget allows a user to select an item using 3 ...
3
votes
1answer
104 views

Assessing Relative Maintainability

We (a contractor, actually) are implementing an off the shelf system to replace a legacy homegrown system for the core domain of the company (designing widgets). Unfortunately both systems will have ...
2
votes
1answer
359 views

Push-Based Events in a Services Oriented Architecture

I have come to a point, in building a services oriented architecture (on top of Thrift), that I need to expose events and allow listeners. My initial thought was, "create an EventService" to handle ...
8
votes
2answers
436 views

How to detect achievements in gaming?

I mistakenly posted this to stackoverflow and now posting here based on a suggestion in on that site ... This is a very high level conceptual question. Say in a software application I have 4 ...
-2
votes
3answers
263 views

Do all programs run in a loop? [closed]

I was wondering whether all programs run in a Loop, checking for variable changes then acting upon said changes followed by another Loop. Or do they run in a While statement, waiting for a variable to ...
1
vote
2answers
179 views

Where is interface between button click and event raising defined

When I click on button, might be in windows apps, web apps, etc it has some animation to actually see it clicked and event is raised in background. I've knowledge of events and its attaching to button ...
1
vote
2answers
252 views

In an event-driven environment, how should a “cancel” function abort all further events?

In my iOS app, things are mostly driven by events. The user presses a button The app listens for an external device to be connected to the iOS device Once the device is detected (is connected), an ...
-1
votes
1answer
105 views

Automation Approaches: Events/Triggers/Cron [closed]

It has been my experience, when building websites, that most of the logic of a system is executed when user input is accepted, be it via POSTs, GETs etc. I would like to know what processes or ...
3
votes
3answers
377 views

How to document events?

Code documentation is usually related to a piece of code, be it small (method-level) or larger (class- or namespace-level). However, it is always about the inputs and the outputs of that piece of ...
5
votes
2answers
1k views

Event Driven Programming: A sequence of unfortunate events

I have a very basic game loop whose primary purpose is to check for updates & changes to a list. I have contemplated using event driven programming to replace the game loop/list idea with an ...
2
votes
1answer
227 views

Application protocols and state machines: designing a complicated server

I'm designing and prototyping a server that has the following characteristics: during the daemon's initialization it spawns nine "manager" servers, each of which solves one part of the overall ...
2
votes
2answers
284 views

What are the caveats of the event system built on Messenger rather than on classic .NET events?

MVVM Light and PRISM offer messenger to implement event system. the approximate interface looks like the following one: interface Messanger { void ...
3
votes
1answer
73 views

Event system architecture for networking when performance is concerned

How should I design a system for an action game (think in Golden Axe) where events can happen remotely? I'm using TCP for this because the client is in flash. There's so many options, I can make a ...