java - Big list of events in GWT EventBus -


in examples provided google web toolkit adding event handlers in 1 class whole application.

as in - module1, 2 , 3 events registered in main appcontroller class. find bit monolithic , not better when using mvp pattern declare method called bind() in each of presenters follows:

public class mytestpresenter implements presenter{       private void bind()      {             testevent.eventbus.addhandler(testevent.type, new testeventhandlerimpl() )      }  }   public class testevent {  public static simpleeventbus eventbus = new simpleeventbus() } 

query is:

  1. if our application huge - using 1 eventbus populate more thousand events in - or design in such way have separate instances of event bus each module?.

  2. any cost of keeping static event bus field. better design give it's instance classes - passing around classes through constructor each presenter class having it's reference seems bit of clutter ...

  3. what activity , places in gwt when comes event handling? - can give pointer how understand concept of activity/place in general?

actually dislike event bus implementation in gwt too. i've asked smt about before. develop desktop application , design eventbus in next way.

public interface eventbus {     void fireevent(event event);      <t extends event> void addhandler(class<t> eventtype, handler<t> handler);      interface event {     }      interface handler<e extends event> {         void handle(e event);     } } 

so in usual java application design in other way, here should deal issues connected javascript , on.

if our application huge - using 1 eventbus populate more thousand events in - or design in such way have separate instances of event bus each module?.

i thinking question too. found there no real advantages. modularity can separate visibility of events. , there disadvantage. suppose should deal several eventbusses in same class - code messy. beside should map instances classes somehow.

any cost of keeping static event bus field. better design give it's instance classes - passing around classes through constructor each presenter class having it's reference seems bit of clutter ...

you can both. in new activity-place framework passed parameter.

what activity , places in gwt when comes event handling? - can give pointer how understand concept of activity/place in general?

activity it's old presenter without low level view binding. place history entry used specify windows.


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -