aino-komal / mvp4g

Automatically exported from code.google.com/p/mvp4g
0 stars 0 forks source link

Some Lazy-broadcasting event #54

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
It is a feature request (haven't found it in current issues), like you 
described:

http://groups.google.com/group/mvp4g/msg/1c6bc186ed23ded3

Is it possible to have some lazy event-broadcasting mechanism for MutiModules 
to annotate an event in MainEventBus with smth like @BroadcastEvent and be sure 
that this event will come to all child event buses of modules, when they be 
loaded through another events (so this event must not load a child modules, but 
fire itself for each child module just in moment when they will be loaded).

It will be useful, for example, to update all current views/presenters with 
current user (I hope to use it in pair with @annotatedWith), when he is loaded 
through async-call.

Original issue reported on code.google.com by shaman.sir on 23 Nov 2010 at 3:52

GoogleCodeExporter commented 9 years ago
I think this feature is covered by issue 42 (you can also take a look at this 
discusion: 
http://groups.google.com/group/mvp4g/browse_thread/thread/d8cb08d7073af787/821d4
55f1e8223b7). The approach is a little bit different but the result is the same.

The idea is that you can broadcast an event to any presenters or child modules 
that implement a certain interface.

for example, you will have this event:
void oneEvent(broadcastTo=OneInterface.class);

and for each child module you will need:
public interface OneChildModule extends Mvp4gModule, OneInterface {...}

This way, you can easily broadcast an event.

You can take a look at this 
example:http://code.google.com/p/mvp4g/source/browse/trunk/examples/Mvp4gModules
/src/com/mvp4g/example/client/main/MainEventBus.java

What do you think?

Original comment by plcoir...@gmail.com on 24 Nov 2010 at 12:32

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I think having to broadcast events this way would be very great! And, seems 
this ticket is a duplicate, though. Thank you! #42 will be useful!

Original comment by shaman.sir on 24 Nov 2010 at 3:26

GoogleCodeExporter commented 9 years ago
Thanks for the confirmation. I will set this bug as a duplicate of 42

Original comment by plcoir...@gmail.com on 6 Dec 2010 at 10:51