event-driven-design

Is this a decent Event Driven approach for a windows service?

I'm reading up on event-driven design. I am having trouble getting my head around some of it in practice. I'm considering using this for a windows service that monitors, parses, and handles information coming from a 3rd party TCP stream. Is the following a decent approach, or am I missing something? My plan is to have a the main ser...

Secondary Message Loop vs Separate Input Thread

I am talking about a Windows desktop application. I am looking to write a function such as SelectObject (for example) which blocks the caller till the user clicks on an object in the application's client area. Once the user has selected an object, the function returns a pointer to it. One way to do this is to run a small message loop an...

Is the "sender" in Button_Click(object sender... really the sender?

Ted Faison in a podcast on event-based software design mentioned that "sender" and "self" objects in .NET, C++ and Java event statements such as: private void Button_Click(object sender, RoutedEventArgs e) are a misnomer since e.g. in the above example "sender" is not really the object which produced the event but a proxy, since you w...

EagerReadDerivation: balancing the benefits with the costs

I'm studying Domain-Driven Design and Distributed DDD for an upcoming Silverlight application I'm going to be working on. The EagerReadDerivation pattern seems like it would improve the scalability of the application, but at the cost of increased complexity. The application will have potentially have thousands of users uploading large ...

Problems using ActiveMQ + activemessaging gem in ruby

Hi all, I have AMQ + Activemessaging running in a Rails App. I'm facing a problem with activemessaging not acting on messages when they are received. This is solved once i restart the client. Apparently, it works for a while but not sure when it stops acting weirdly. This is resulting in loss of messages as they are being read, the St...

Event driven with Java and Javascript?

I am trying to perform some computations on a server. For this, the client initially inputs some data which I am capturing through Javascript. Now, I would perhaps make a XMLHttpRequest to a server to send this data. Let's say the computation takes an hour and the client leaves the system or switches off the system. In practice, I woul...

Event driven vs sequential programming

One of my friend recently had an argument in his team about the pros and cons of event driven programming vs sequential programming. What are your views about it? ...

Polling vs Events for environmental logging to database

I will be using the PhidgetSBC as the device that will be connected to the various sensors (Temperature, humidity, CO2, on/off sensors, range finders, etc). It will also be used to control certain things (think home brew home automation). The code on the SBC will be handling data capture of the sensor readings (if polling it would be e...

Asynchronous programming using Java

Where can I find asynchronous programming example using Java? I'm interested in finding patterns in asynchronous programming for building applications that present responsiveness (preventing applications that periodically hang and stop responding to user input and server applications that do not respond to client requests in a timely fas...

C# Event Handlers Using an Enum

I have a StatusChanged event that is raised by my object when its status changes - however, the application needs to carry out additional actions based on what the new status is. e.g If the new status is Disconnected, then it must update the status bar text and send an email notification. So, I wanted to create an Enum with the possibl...

How can I handle all my errors/messages in one place on an Asp.Net page?

Hi all, I'm looking for some guidance here. On my site I put things in Web user controls. For example, I will have a NewsItem Control, an Article Control, a ContactForm control. These will appear in various places on my site. What I'm looking for is a way for these controls to pass messages up to the Page that they exist on. I don'...

jQuery plugin for Event Driven Architecture?

Are there any Event Driven Architecture jQuery plugins? Step 1: Subscribing The subscribers subscribe to the event handler in the middle, and pass in a callback method, as well as the name of the event they are listening for... i.e. The two green subscribers will be listening for p0 events. And the blue subscriber will be listening ...

Passing http form values to a C program

I've been assigned to upgrade an embedded application written in C. The application is configured via a web interface. When the user modifies the web application a file is written to /var/www/settings.json and the file /var/www/UPDATE_SETTINGS is touched. In the main application loop it checks to see if UPDATE_SETTINGS exists. If it do...

Event driven architecture...infinite loop

I have an event driven architecture where A is waiting for a change from B and B is waiting for a change from C and C is waiting for a change from A, forming a cycle. Now, if B changes, then A fires an event to C, which fires to B, which fires to A, which fires to C...ad infinitum. I can change my program right now to not contain thi...

Design question on Python network programming

I'm currently writing a project in Python which has a client and a server part. I have troubles with the network communication, so I need to explain some things... The client mainly does operations the server tells him to and sends the results of the operations back to the server. I need a way to communicate bidirectional on a TCP socke...