Renat Zubairov wrote:
> Hello all,
>
> I want to implement an Observer design patterns with Guice. What kind
> of support may I get from a framework?
>
>   
You might want to take a look at Guts-Event 
(http://kenai.com/projects/guts). Although not officially released the 
source code in SVN is rather stable, fully javadoc'ed (with snippets) 
and works pretty well as far as I can tell.
Note, however, that it doesn't exactly work the way you describe, but as 
follows:
- Modules define bindings to event Channels (one channel is identified 
by: event type, topic name)
- Channels are injectable anywhere and are used to push events to observers
- Observers (called consumers in guts-events) are just methods annotated 
with @Consumes and are automatically registered by guts-events on 
classes instantiated / injected by Guice.

These are just the basics, there is more (event filtering, management of 
threads to call consumers, priorities of consumer calls...)
All is fully type-safe.

If you find it interesting but you're missing some features, don't 
hesitate to comment on the project site (please note that Guts project 
doesn't contain only guts-events but it has also other "sub projects").

Cheers

Jean-Francois
> In ideal case I could imagine following:
> - Module would configure Observers as services
> - Module would configure Observable as service
> - Module would inject one into another or Observable would get all
> listeners injected based on some particular interface/annotation.
>
> Any ideas?
>
> Renat
>
> >
>
>   


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-guice?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to