views:

44

answers:

1

I want suggestion any design pattern in which I want to process unlimited events.

I am not sure how many events I may get when the system is running. I have some actions defined on those events.

I am looking for solutions which can give me processing actions in near real time.

A: 

Does Chain of Responsibility work for you?

You would give all the event producers an object to send the events to, and that object would pass the event down from rule to rule until it is fully handled.

Also when building GUI applications in Java I need to deal with many graphical components which generate various events based on user actions, and based on what event happens I need to implement rules for what happens.

I am not sure the name of the basic event listener pattern that is in use in Swing, but that might work for you too.

If you mean real time like GUI response time, then just calling out to an event handler should be plenty fast, that is what happens in Swing.

If I knew more about how or where these events are being generated then there may be a better pattern that I could suggest.

Sarah Happy