Results 1 to 2 of 2

Thread: Which is better: ELF vs. Spring Events ?

  1. #1
    Join Date
    Jul 2006
    Location
    Houston, TX
    Posts
    80

    Question Which is better: ELF vs. Spring Events ?

    I have seen a few people in this forum are using the ELF framework for event publishing. Is there any advantage to using the ELF framework over the current Spring RCP-style events such as ApplicationLifeCycleEvent which are published using getApplicationContext().publishEvent(...) ?

    -Trey

  2. #2
    Join Date
    Aug 2004
    Location
    San Francisco
    Posts
    423

    Default

    Trey,

    I use ELF for my internal application event passing. There's a couple of things I like about it. The biggest thing for me is that it allows you to specify your own event classes and associate listeners. So rather than processing generic ApplicationEvent you process your own specific event with any associated semantics you give it. It also allows you to map event types to specific methods within a listener, much like swing has multiple methods in a MouseListener for example. Finally, it has the concept of event channels which means events get propagated only to the listeners that are interested.
    All of these make the code much easier to read and maintain as opposed to the usual if(event instanceof x) constructs you end up seeing with generic event listeners.

    I'm sure you could do something along these lines with the spring event system either with a more advanced event dispatcher implementation (that might actually be a way to integrate ELF with Spring) or with some sort of application specific event handler implementation.

    Jonny

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •