View Poll Results: Do you use spring to handle your events?
- 5. You may not vote on this poll
I don't have events.
Mar 16th, 2006, 02:16 AM
JMS is J(2)EE only, it's for asynchronish messaging.
Andy: Could you describe some use cases of the event framework?
One of the things I have problems with in spring-richclient is the following use case:
- There are several check boxes in the form
- When checkbox a is clicked every other fields/checkboxes become read-only (nothing goes empty)
a is to set the record to "inactive"
- When checkbox b is clicked the fields become disabled + empty.
b is to make disable some fields when they don't apply
Currently I 've done the read-only/disabled state in a refreshMetaData() method, using the ValueModel (not the Value Object directly as the form hasn't been comitted to it yet) ... which is casting hell.
The empty-ing I cannot do in the refresh-metadata, as it's a one time thing the user can overrule later, so I do that in a regular Swing event listener.
Any pointers on how to improve this solution?
Mar 16th, 2006, 10:34 AM
There are conceptual similarities between the event bus idea and JMS. In fact, there's an in jvm implementation of a jms provider the author aims at exactly this problem:
I've never used it though. I'm pretty sure activeMq can also be embedded and used within the jvm.
As for use cases. To me the main use is to avoid coupling between an event publisher and a subscriber. They don't know anything about each other. This works great, for example, where mutliple views have to update their content based on an event in another window, result of a command execution etc.
I'm not sure it fits your example or not, I don't fully follow, but you could, using elf, fire your own events on the selection change and anything that needed to update their state could then listen on these specific events. I do a similar thing all the time with table selection.
Mar 16th, 2006, 10:41 AM
Hi, I am the developer of ELF. jwray pointed me here to see how people think about event listening in Spring Rich. I personally don't have experience with Spring Rich and the original idea of ELF is to hava a framework to facilatate component programming. The goal of ELF is actually a lot like Spring but went into a different route.
Anyhow, a quick comment on the event dispatch provided by Spring is that you have to develop your class with Spring specific event/listener classes. With ELF, you can define yourown event/listener classes which brings more flexibility. This is particular useful when you are using third party swing/swt components cuz you don't have control over them. Another key benefit is that ELF provides better debugging/statistic function than Spring core. I personally find debugging in a fully distributed enviornment is a big hassle. Enhancing debug capacity would be my next task. (if I ever get to finish the tutorial....) For more usage of ELF, please see the tutorial at Walking with ELF
Anyhow, comments and suggestions are very welcome. jwray has also suggested me to integrate ELF with Spring Rich. I will look into the possibility and of course, see if there is a need for it.
BTW, JMS is too heavy/slow for a client application. Your events will have to travel to the JMS server and be picked up later by another thread of the same application. It will definately work, but probably too slow for an interactive intense client app.
Mar 16th, 2006, 02:48 PM
Need someone to maven2ize ELF?
It's a single module, shouldn't take long or a lot of effort. If it's ok, I can make you a pom.xml this weekend.
If ELF also builds with maven 2, it's easier for us to depend on it, as we don't have to worry about transitive dependencies and it's a lot easier to upgrade to new snapshots or releases.
Mar 16th, 2006, 05:43 PM
Sounds good. I am not familier with Maven. Could you explain how it works and how do I maintain this pom.xml ? Thanks a lot!!
Mar 16th, 2006, 08:52 PM
somnifugijms is why I belive There are conceptual similarities between them.
Originally Posted by jwray
I don't have much experience about SWING, my most projects are web based. But I am tring to write one now.
Mar 16th, 2006, 08:56 PM
The problem with somnofungi and other JMS or JMX implementations is that they are *too* multithreaded. Most of the time you want the message delivered on the same stack frame, if possible (click a button and the message for the button will be handled by the controller during the click). In the Swing version, you take it from any thread and consume it on the Swing EDT thread.
JMX is also a bit more complicated. JMX is a cross-process communication layer, the EventBus is specifically in-process.
When I say EventBus, I'm specifically referrring to my project, http://eventbus.dev.java.net, but I think ELF is similar.
Mar 16th, 2006, 09:01 PM
Maybe it is too hard to explain maven in a post.
Originally Posted by chunju
Basically it is a "building system" trying to solve technical problems of project management. For example, it can pull all needed jar form internet for you. It makes your project more "friendly" to others (their maven can pull you jars form internet for them)
And it is easy to use,as long as you understand its idea.
has more information.
BTW, your id is interesting
Last edited by siberian; Mar 16th, 2006 at 09:05 PM.
Mar 16th, 2006, 09:08 PM
I know maven as it's a build management but was never set up one successfully.
why is my id interesting?
Do you think we can work together on exchanging some ideas, even some implementations?
Mar 16th, 2006, 09:30 PM
I suppose your id is pinyin?
If you are using eclipse, try maven's eclipse plugin
A good start.They have two flash demos.
Last edited by siberian; Mar 16th, 2006 at 09:51 PM.