|
From: Dmitriy K. <dko...@ru...> - 2004-09-18 14:14:13
|
Juergen, The main reason I've introduced ApplicationEventPublisher interface is to factor out event publishing from the ApplicationContext interface. I am totally happy with your suggested design. Regards, Dmitriy. jürgen höller [werk3AT] wrote: >Dmitriy, > >I've seen that you've added an ApplicationEventPublisher interface plus SimpleApplicationEventPublisher implementation, used as base class for EventPublicationInterceptor. I'm not sure if those really add value: EventPublicationInterceptor *derives* from SimpleApplicationEventPublisher, so it doesn't leverage the pluggability offered by the ApplicationEventPublisher interface. > >If we want to factor out event publishing from the ApplicationContext interface, I suggest to add an ApplicationEventPublisher interface to the org.springframework.context package, extended by the ApplicationContext interface. We've used the same strategy for the MessageSource and ResourceLoader interfaces. (Have a look at the interfaces that ApplicationContext extends.) > >We could then add an ApplicationEventPublisherAware interface, which beans can implement to automatically receive a reference to an ApplicationEventPublisher (usually the containing ApplicationContext). EventPublicationInterceptor can then simply implement that interface, rather than ApplicationContextAware, allowing it to be used with any ApplicationEventPublisher. > >For a comparison, have a look at the ReloadableResourceBundleMessageSource's implementation: It implements ResourceLoaderAware to automatically receive a containing ApplicationContext as ResourceLoader. Additionally, it has a DefaultResourceLoader as default, to allow for usage outside an ApplicationContext too. You could also pass in a custom ResourceLoader implementation. > >What do you think? If my suggested redesign fits your needs, I'm happy to apply it before the 1.1.1 release. > >Juergen > > > >------------------------------------------------------- >This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 >Project Admins to receive an Apple iPod Mini FREE for your judgement on >who ports your project to Linux PPC the best. Sponsored by IBM. >Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php >_______________________________________________ >Springframework-developer mailing list >Spr...@li... >https://lists.sourceforge.net/lists/listinfo/springframework-developer > > |