Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Singleton EventPublisher/Listener

Status
Not open for further replies.

zooxmusic

Programmer
Nov 24, 2004
96
US
Hi all, I am building a JSR-296 swing app ontop of a spring backend using remote services. The new BSAF has a pretty nice @Action/Task architecture. My basic question is;

I need, pretty much everywhere, to register as a listener for Task events but my objects are disparate. Meaning I have no easy way to get from the class I want to listen to the task event to register myself as a listener.

What is the suggested way to handle this?

I was toying with a Singleton EventQueue for my application but I do not feel warm and fuzzy about it. I am not sure why I don't feel warm and fuzzy but I don't. Maybe because it reminds me of the WM_* windows message system.


Thanks in advance

Brian

Spend like you don't need the money,
love like you've never been hurt and dance like nobody's watching!
 
You know, after reading a bit on Martin Fowler's site and a few others, I am completely warm and fuzzy about an event architecture. It decouples my code even more. I was actually feeling opposite of how I should have been. I also have found EventBus for swing and non-swing and looks to be pretty robust. If anyone is interested it is located here;



I still wouldn't mind starting a discussion on the pros and cons of this approach.


Brian

Spend like you don't need the money,
love like you've never been hurt and dance like nobody's watching!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top