<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Event registry</title>
	<atom:link href="http://nutrun.com/weblog/event-registry/feed/" rel="self" type="application/rss+xml" />
	<link>http://nutrun.com/weblog/event-registry/</link>
	<description>nutrun</description>
	<pubDate>Sat, 06 Sep 2008 04:24:38 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.1</generator>
		<item>
		<title>By: Sriram</title>
		<link>http://nutrun.com/weblog/event-registry/#comment-450</link>
		<dc:creator>Sriram</dc:creator>
		<pubDate>Wed, 23 Apr 2008 04:47:55 +0000</pubDate>
		<guid isPermaLink="false">http://nutrun.com/?p=135#comment-450</guid>
		<description>Nice write up. 

I would prefer that the WelcomeLetterService have some hand in asking for notifications while still remaining oblivious of RM. This could be implemented by a 2-stage event notification. Notifiers only notify event registry and the registry notifies interested parties. In this case, EventRegistry is also an EventDispatcher. The first stage of this doesn't have to be a notification, can be a simple method call (RM knows that there is only one subscriber that it needs to be concerned about viz. EventRegistry.) 

class WelcomeLetterService
  #instead of RM
  EventRegistry.subscribe(:new_recruit) {&#124;name&#124; greet(name)}

  def self.greet(name)
    "Welcome, #{name}!"
  end
end</description>
		<content:encoded><![CDATA[<p>Nice write up. </p>
<p>I would prefer that the WelcomeLetterService have some hand in asking for notifications while still remaining oblivious of RM. This could be implemented by a 2-stage event notification. Notifiers only notify event registry and the registry notifies interested parties. In this case, EventRegistry is also an EventDispatcher. The first stage of this doesn&#8217;t have to be a notification, can be a simple method call (RM knows that there is only one subscriber that it needs to be concerned about viz. EventRegistry.) </p>
<p>class WelcomeLetterService<br />
  #instead of RM<br />
  EventRegistry.subscribe(:new_recruit) {|name| greet(name)}</p>
<p>  def self.greet(name)<br />
    &#8220;Welcome, #{name}!&#8221;<br />
  end<br />
end</p>
]]></content:encoded>
	</item>
</channel>
</rss>
