<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Domain Events &#8211; Salvation</title>
	<atom:link href="http://www.udidahan.com/2009/06/14/domain-events-salvation/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.udidahan.com/2009/06/14/domain-events-salvation/</link>
	<description>Enterprise Development Expert &#38; SOA Specialist</description>
	<lastBuildDate>Sat, 13 Mar 2010 15:04:13 -0600</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: udidahan</title>
		<link>http://www.udidahan.com/2009/06/14/domain-events-salvation/comment-page-3/#comment-37061</link>
		<dc:creator>udidahan</dc:creator>
		<pubDate>Sun, 28 Feb 2010 14:29:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.udidahan.com/?p=1029#comment-37061</guid>
		<description>Julien,

Encoding a password sounds like functionality that isn&#039;t very volatile - so you can probably implement it outside the domain model. You&#039;ll probably have an in-memory dictionary of ClientID to EncodingStrategy, which you can look up in your service layer, encode, and then persist.

Not everything needs to be done using a domain model :)</description>
		<content:encoded><![CDATA[<p>Julien,</p>
<p>Encoding a password sounds like functionality that isn&#8217;t very volatile &#8211; so you can probably implement it outside the domain model. You&#8217;ll probably have an in-memory dictionary of ClientID to EncodingStrategy, which you can look up in your service layer, encode, and then persist.</p>
<p>Not everything needs to be done using a domain model <img src='http://www.udidahan.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Julien Letrouit</title>
		<link>http://www.udidahan.com/2009/06/14/domain-events-salvation/comment-page-3/#comment-37049</link>
		<dc:creator>Julien Letrouit</dc:creator>
		<pubDate>Thu, 25 Feb 2010 19:10:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.udidahan.com/?p=1029#comment-37049</guid>
		<description>Udi,

  oops, looks like I did not read the fine prints in details. Sorry for that.
  I tried to see if I could salvage all the calls to services in my domain using this design, and there are still a couple of places where I can&#039;t see events to fit elegantly. For example, my User entity need a IEncodePassword (implementation is different from one customer to the other) when one of my user is changing his/her password. Would you still remove that service dependency from the User entity?

  Julien</description>
		<content:encoded><![CDATA[<p>Udi,</p>
<p>  oops, looks like I did not read the fine prints in details. Sorry for that.<br />
  I tried to see if I could salvage all the calls to services in my domain using this design, and there are still a couple of places where I can&#8217;t see events to fit elegantly. For example, my User entity need a IEncodePassword (implementation is different from one customer to the other) when one of my user is changing his/her password. Would you still remove that service dependency from the User entity?</p>
<p>  Julien</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: udidahan</title>
		<link>http://www.udidahan.com/2009/06/14/domain-events-salvation/comment-page-3/#comment-37043</link>
		<dc:creator>udidahan</dc:creator>
		<pubDate>Tue, 23 Feb 2010 16:30:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.udidahan.com/?p=1029#comment-37043</guid>
		<description>Julien,

Domain event handlers would be registered in the container at startup. Thus the service layer doesn&#039;t have to register anything. The registering of an action callback is there primarily for testing purposes. Hope that clears it up for you.</description>
		<content:encoded><![CDATA[<p>Julien,</p>
<p>Domain event handlers would be registered in the container at startup. Thus the service layer doesn&#8217;t have to register anything. The registering of an action callback is there primarily for testing purposes. Hope that clears it up for you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Julien Letrouit</title>
		<link>http://www.udidahan.com/2009/06/14/domain-events-salvation/comment-page-3/#comment-37041</link>
		<dc:creator>Julien Letrouit</dc:creator>
		<pubDate>Mon, 22 Feb 2010 23:04:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.udidahan.com/?p=1029#comment-37041</guid>
		<description>Udi,

  Thanks for your great blog, you opened my eyes on so many subjects :) I have however a problem with this domain event dispatcher: every caller of domain logic that will trigger a given event must register the events themselves. So, the email will be sent when the customer become preferred only if all the methods in the service layer did not forget to register the event everywhere it might be raised.
  I would personally add a way to register handler types, so whenever an event occur, the compatible handlers will be instantiated and called, whether the service layer registered the event or not. Then only will be get the assurance the email is sent in every situation the customer becomes preferred.

  Or do I miss something?</description>
		<content:encoded><![CDATA[<p>Udi,</p>
<p>  Thanks for your great blog, you opened my eyes on so many subjects <img src='http://www.udidahan.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  I have however a problem with this domain event dispatcher: every caller of domain logic that will trigger a given event must register the events themselves. So, the email will be sent when the customer become preferred only if all the methods in the service layer did not forget to register the event everywhere it might be raised.<br />
  I would personally add a way to register handler types, so whenever an event occur, the compatible handlers will be instantiated and called, whether the service layer registered the event or not. Then only will be get the assurance the email is sent in every situation the customer becomes preferred.</p>
<p>  Or do I miss something?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: DDDSample.NET 0.5, finally asynchronous! &#171; Simon says&#8230; architecture!</title>
		<link>http://www.udidahan.com/2009/06/14/domain-events-salvation/comment-page-3/#comment-36991</link>
		<dc:creator>DDDSample.NET 0.5, finally asynchronous! &#171; Simon says&#8230; architecture!</dc:creator>
		<pubDate>Thu, 21 Jan 2010 13:00:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.udidahan.com/?p=1029#comment-36991</guid>
		<description>[...] NHibernate. In this mode NHibernate is used to persist domain model data. Inter-aggregate communicaton is done synchronously using domain event pattern. [...]</description>
		<content:encoded><![CDATA[<p>[...] NHibernate. In this mode NHibernate is used to persist domain model data. Inter-aggregate communicaton is done synchronously using domain event pattern. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roger</title>
		<link>http://www.udidahan.com/2009/06/14/domain-events-salvation/comment-page-3/#comment-36921</link>
		<dc:creator>Roger</dc:creator>
		<pubDate>Sun, 03 Jan 2010 20:57:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.udidahan.com/?p=1029#comment-36921</guid>
		<description>What is this code snippet trying to do?

30:        if (actions != null)  
31:            foreach (var action in actions)  
32:                if (action is Action)  
33:                    ((Action)action)(args);

Looks like it is trying to invoke a callback. But there is not invoke() function. If it is, do we still need to this? The domain event handler already sent the e-mail out. 

Thanks.</description>
		<content:encoded><![CDATA[<p>What is this code snippet trying to do?</p>
<p>30:        if (actions != null)<br />
31:            foreach (var action in actions)<br />
32:                if (action is Action)<br />
33:                    ((Action)action)(args);</p>
<p>Looks like it is trying to invoke a callback. But there is not invoke() function. If it is, do we still need to this? The domain event handler already sent the e-mail out. </p>
<p>Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Advanced StructureMap: connecting implementations to open generic types - Jimmy Bogard - Los Techies : Blogs about software and anything tech!</title>
		<link>http://www.udidahan.com/2009/06/14/domain-events-salvation/comment-page-3/#comment-36910</link>
		<dc:creator>Advanced StructureMap: connecting implementations to open generic types - Jimmy Bogard - Los Techies : Blogs about software and anything tech!</dc:creator>
		<pubDate>Fri, 18 Dec 2009 02:40:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.udidahan.com/?p=1029#comment-36910</guid>
		<description>[...] is an interface for domain events, where we’ll have handlers [...]</description>
		<content:encoded><![CDATA[<p>[...] is an interface for domain events, where we’ll have handlers [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: udidahan</title>
		<link>http://www.udidahan.com/2009/06/14/domain-events-salvation/comment-page-3/#comment-36897</link>
		<dc:creator>udidahan</dc:creator>
		<pubDate>Sat, 12 Dec 2009 14:31:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.udidahan.com/?p=1029#comment-36897</guid>
		<description>Josh,

The point that you raise is an excellent one, and goes to the heart of designing domain models. It is the responsibility of the aggregate root that its state changes be in-sync with those of its collaborating entities.

In short, the domain model is a tightly coupled set of classes that need to handle this. If they don&#039;t, there&#039;s nothing anybody can do from the outside to fix it.

Designing a good domain model is hard, and ensuring that each aggregate root retains its logical consistency is one of those things that needs to be addressed.

Sorry that there is no silver bullet for that one :)</description>
		<content:encoded><![CDATA[<p>Josh,</p>
<p>The point that you raise is an excellent one, and goes to the heart of designing domain models. It is the responsibility of the aggregate root that its state changes be in-sync with those of its collaborating entities.</p>
<p>In short, the domain model is a tightly coupled set of classes that need to handle this. If they don&#8217;t, there&#8217;s nothing anybody can do from the outside to fix it.</p>
<p>Designing a good domain model is hard, and ensuring that each aggregate root retains its logical consistency is one of those things that needs to be addressed.</p>
<p>Sorry that there is no silver bullet for that one <img src='http://www.udidahan.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Josh</title>
		<link>http://www.udidahan.com/2009/06/14/domain-events-salvation/comment-page-3/#comment-36885</link>
		<dc:creator>Josh</dc:creator>
		<pubDate>Thu, 10 Dec 2009 19:21:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.udidahan.com/?p=1029#comment-36885</guid>
		<description>Could you answer Joe&#039;s question from &quot;September 3rd, 2009 at 9:47 am&quot; when you get a chance?
&quot;In your original post (the 1st design) somebody was concerned about a failure event in a first domain method call not preventing a second domain method call. You responded by saying that only a single domain method call should be made because anything more means domain meaning has found it’s way into the service layer message handler.

One of the problems Domain Events solves is getting domain related fault events out of the domain even in situations where entities may be deeply nested. What happens if a method is called on an aggregate root, it delegates to one of it’s underlying entities, the entity raises a fault event, and the aggregate root, not knowing a fault occurred, changes some of its state and returns? The changes to the aggregate root will be committed right? How do you protect against this type of situation?&quot;</description>
		<content:encoded><![CDATA[<p>Could you answer Joe&#8217;s question from &#8220;September 3rd, 2009 at 9:47 am&#8221; when you get a chance?<br />
&#8220;In your original post (the 1st design) somebody was concerned about a failure event in a first domain method call not preventing a second domain method call. You responded by saying that only a single domain method call should be made because anything more means domain meaning has found it’s way into the service layer message handler.</p>
<p>One of the problems Domain Events solves is getting domain related fault events out of the domain even in situations where entities may be deeply nested. What happens if a method is called on an aggregate root, it delegates to one of it’s underlying entities, the entity raises a fault event, and the aggregate root, not knowing a fault occurred, changes some of its state and returns? The changes to the aggregate root will be committed right? How do you protect against this type of situation?&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: udidahan</title>
		<link>http://www.udidahan.com/2009/06/14/domain-events-salvation/comment-page-3/#comment-36855</link>
		<dc:creator>udidahan</dc:creator>
		<pubDate>Wed, 02 Dec 2009 02:43:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.udidahan.com/?p=1029#comment-36855</guid>
		<description>Jon,

The handling of a domain event wouldn&#039;t send the email directly, instead it would send a message using a bus to another endpoint, and that is the one that would send the email. That would provide for full transactional guarantees. You can look at NServiceBus for those kinds of bus capabilities.

Does that answer your question?</description>
		<content:encoded><![CDATA[<p>Jon,</p>
<p>The handling of a domain event wouldn&#8217;t send the email directly, instead it would send a message using a bus to another endpoint, and that is the one that would send the email. That would provide for full transactional guarantees. You can look at NServiceBus for those kinds of bus capabilities.</p>
<p>Does that answer your question?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon</title>
		<link>http://www.udidahan.com/2009/06/14/domain-events-salvation/comment-page-3/#comment-36854</link>
		<dc:creator>Jon</dc:creator>
		<pubDate>Tue, 01 Dec 2009 17:18:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.udidahan.com/?p=1029#comment-36854</guid>
		<description>Udi,

I&#039;m still getting my head round how this will work. In your example, presumably your DoSomething() method would actually look like this:

IsPreferred = true;
DomainEvents.Raise(new CustomerBecamePreferred() { Customer = this });

Suppose you have a handler that fires an email. What happens if the transaction in the service that calls the DoSomething() method fails (the database is down for instance)? Won&#039;t the email still get sent even though the IsPreferred change was not persisted?

Thanks, Jon</description>
		<content:encoded><![CDATA[<p>Udi,</p>
<p>I&#8217;m still getting my head round how this will work. In your example, presumably your DoSomething() method would actually look like this:</p>
<p>IsPreferred = true;<br />
DomainEvents.Raise(new CustomerBecamePreferred() { Customer = this });</p>
<p>Suppose you have a handler that fires an email. What happens if the transaction in the service that calls the DoSomething() method fails (the database is down for instance)? Won&#8217;t the email still get sent even though the IsPreferred change was not persisted?</p>
<p>Thanks, Jon</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Simple Domain Events &#171; BASICly everything</title>
		<link>http://www.udidahan.com/2009/06/14/domain-events-salvation/comment-page-3/#comment-36841</link>
		<dc:creator>Simple Domain Events &#171; BASICly everything</dc:creator>
		<pubDate>Sun, 15 Nov 2009 12:20:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.udidahan.com/?p=1029#comment-36841</guid>
		<description>[...] pattern, so use at your own risk. A lot of this post was blatantly ripped off from inspired by Udi Dahan’s posts on the same subject. Other bits and pieces come from around the ‘net. Sorry I’m not giving credit. At the time, I [...]</description>
		<content:encoded><![CDATA[<p>[...] pattern, so use at your own risk. A lot of this post was blatantly ripped off from inspired by Udi Dahan’s posts on the same subject. Other bits and pieces come from around the ‘net. Sorry I’m not giving credit. At the time, I [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: udidahan</title>
		<link>http://www.udidahan.com/2009/06/14/domain-events-salvation/comment-page-3/#comment-36840</link>
		<dc:creator>udidahan</dc:creator>
		<pubDate>Sat, 14 Nov 2009 13:22:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.udidahan.com/?p=1029#comment-36840</guid>
		<description>Angus,

Several containers support this out of the box, like Spring and Castle.

Hope that helps.</description>
		<content:encoded><![CDATA[<p>Angus,</p>
<p>Several containers support this out of the box, like Spring and Castle.</p>
<p>Hope that helps.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Angus McDonald</title>
		<link>http://www.udidahan.com/2009/06/14/domain-events-salvation/comment-page-2/#comment-36836</link>
		<dc:creator>Angus McDonald</dc:creator>
		<pubDate>Sun, 08 Nov 2009 23:24:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.udidahan.com/?p=1029#comment-36836</guid>
		<description>Udi,

I&#039;m trying to wire this up to try it out, but I can&#039;t for the life of me work out what IContainer you are using. It looks like the one from NServiceBus 2.0 (with the extension method ResolveAll) but I&#039;ve had a hard time bringing in references that make that work in my project.

This means I can&#039;t get this line of code to compile:
foreach (var handler in Container.ResolveAll&lt;Handles&gt;())

Any help would be appreciated!

Thanks,
Angus</description>
		<content:encoded><![CDATA[<p>Udi,</p>
<p>I&#8217;m trying to wire this up to try it out, but I can&#8217;t for the life of me work out what IContainer you are using. It looks like the one from NServiceBus 2.0 (with the extension method ResolveAll) but I&#8217;ve had a hard time bringing in references that make that work in my project.</p>
<p>This means I can&#8217;t get this line of code to compile:<br />
foreach (var handler in Container.ResolveAll&lt;Handles&gt;())</p>
<p>Any help would be appreciated!</p>
<p>Thanks,<br />
Angus</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Think Before Coding</title>
		<link>http://www.udidahan.com/2009/06/14/domain-events-salvation/comment-page-2/#comment-36827</link>
		<dc:creator>Think Before Coding</dc:creator>
		<pubDate>Fri, 30 Oct 2009 13:55:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.udidahan.com/?p=1029#comment-36827</guid>
		<description>Manual trackback : Event sourcing and CQRS, now !
http://thinkbeforecoding.com/post/2009/10/30/Event-Sourcing-and-CQRS-Now</description>
		<content:encoded><![CDATA[<p>Manual trackback : Event sourcing and CQRS, now !<br />
<a href="http://thinkbeforecoding.com/post/2009/10/30/Event-Sourcing-and-CQRS-Now" rel="nofollow">http://thinkbeforecoding.com/post/2009/10/30/Event-Sourcing-and-CQRS-Now</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: udidahan</title>
		<link>http://www.udidahan.com/2009/06/14/domain-events-salvation/comment-page-2/#comment-36825</link>
		<dc:creator>udidahan</dc:creator>
		<pubDate>Thu, 29 Oct 2009 21:25:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.udidahan.com/?p=1029#comment-36825</guid>
		<description>Jon,

See my post:

http://www.udidahan.com/2009/06/29/dont-create-aggregate-roots/

Does that answer your question?</description>
		<content:encoded><![CDATA[<p>Jon,</p>
<p>See my post:</p>
<p><a href="http://www.udidahan.com/2009/06/29/dont-create-aggregate-roots/" rel="nofollow">http://www.udidahan.com/2009/06/29/dont-create-aggregate-roots/</a></p>
<p>Does that answer your question?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon</title>
		<link>http://www.udidahan.com/2009/06/14/domain-events-salvation/comment-page-2/#comment-36824</link>
		<dc:creator>Jon</dc:creator>
		<pubDate>Thu, 29 Oct 2009 17:01:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.udidahan.com/?p=1029#comment-36824</guid>
		<description>Udi, what happens when the domain event is reliant on some kind of infrastructure? For instance, what if I wanted to have a CustomerCreated domain event. I could raise the event in the constructor of the Customer entity, but typically a business doesnt see a Customer as Created until its actually been saved in the database.</description>
		<content:encoded><![CDATA[<p>Udi, what happens when the domain event is reliant on some kind of infrastructure? For instance, what if I wanted to have a CustomerCreated domain event. I could raise the event in the constructor of the Customer entity, but typically a business doesnt see a Customer as Created until its actually been saved in the database.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: udidahan</title>
		<link>http://www.udidahan.com/2009/06/14/domain-events-salvation/comment-page-2/#comment-36816</link>
		<dc:creator>udidahan</dc:creator>
		<pubDate>Sat, 24 Oct 2009 15:16:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.udidahan.com/?p=1029#comment-36816</guid>
		<description>Joni,

There&#039;s never enough time to do it right, but there&#039;s always enough time to do it again :)</description>
		<content:encoded><![CDATA[<p>Joni,</p>
<p>There&#8217;s never enough time to do it right, but there&#8217;s always enough time to do it again <img src='http://www.udidahan.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joni Ben-Ami</title>
		<link>http://www.udidahan.com/2009/06/14/domain-events-salvation/comment-page-2/#comment-36815</link>
		<dc:creator>Joni Ben-Ami</dc:creator>
		<pubDate>Sat, 24 Oct 2009 11:16:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.udidahan.com/?p=1029#comment-36815</guid>
		<description>Udi, the decision not to use an ORM essentially stems from lack of resources and conservativism. The project as a whole is relatively small and after some research, it seemed more time- and cost-efficient to build our own persistence framework. As for messaging, it has up until now been unnecessary, and the conservativism I mentioned implies minimal changes as well as minimal external components.

But I will keep these things in mind next time I have an opportunity to implement them.</description>
		<content:encoded><![CDATA[<p>Udi, the decision not to use an ORM essentially stems from lack of resources and conservativism. The project as a whole is relatively small and after some research, it seemed more time- and cost-efficient to build our own persistence framework. As for messaging, it has up until now been unnecessary, and the conservativism I mentioned implies minimal changes as well as minimal external components.</p>
<p>But I will keep these things in mind next time I have an opportunity to implement them.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: udidahan</title>
		<link>http://www.udidahan.com/2009/06/14/domain-events-salvation/comment-page-2/#comment-36814</link>
		<dc:creator>udidahan</dc:creator>
		<pubDate>Sat, 24 Oct 2009 07:38:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.udidahan.com/?p=1029#comment-36814</guid>
		<description>Sam,

Yes, domain events can contain data as well as references to domain objects.</description>
		<content:encoded><![CDATA[<p>Sam,</p>
<p>Yes, domain events can contain data as well as references to domain objects.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: udidahan</title>
		<link>http://www.udidahan.com/2009/06/14/domain-events-salvation/comment-page-2/#comment-36813</link>
		<dc:creator>udidahan</dc:creator>
		<pubDate>Sat, 24 Oct 2009 07:37:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.udidahan.com/?p=1029#comment-36813</guid>
		<description>Joni,

Building a true domain model without having something like an ORM is possible, but you&#039;d best forgo a relational persistence storage as well. Without an actual domain model, it isn&#039;t entirely clear what kind of domain events would be raised.

Even if you did have an ORM, the transactional behavior of processing a domain event would likely require some kind of transactional messaging infrastructure, not to mention other fault-tolerance scenarios which require it.

On what was the decision not to use either of these in your project based?</description>
		<content:encoded><![CDATA[<p>Joni,</p>
<p>Building a true domain model without having something like an ORM is possible, but you&#8217;d best forgo a relational persistence storage as well. Without an actual domain model, it isn&#8217;t entirely clear what kind of domain events would be raised.</p>
<p>Even if you did have an ORM, the transactional behavior of processing a domain event would likely require some kind of transactional messaging infrastructure, not to mention other fault-tolerance scenarios which require it.</p>
<p>On what was the decision not to use either of these in your project based?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sam</title>
		<link>http://www.udidahan.com/2009/06/14/domain-events-salvation/comment-page-2/#comment-36810</link>
		<dc:creator>Sam</dc:creator>
		<pubDate>Thu, 22 Oct 2009 21:34:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.udidahan.com/?p=1029#comment-36810</guid>
		<description>Hello,
Is it ok for domain events to contain data too?

If I have ResultIsAvailable event, is it ok for it to have a Result property which the listener can access, or should domain events be used for sending messages only? i.e., should it be
&quot;A result is available and here it is&quot;

or just

&quot;A result is available.&quot;

I&#039;d much prefer to use the former if it doesn&#039;t raise any coupling issues.</description>
		<content:encoded><![CDATA[<p>Hello,<br />
Is it ok for domain events to contain data too?</p>
<p>If I have ResultIsAvailable event, is it ok for it to have a Result property which the listener can access, or should domain events be used for sending messages only? i.e., should it be<br />
&#8220;A result is available and here it is&#8221;</p>
<p>or just</p>
<p>&#8220;A result is available.&#8221;</p>
<p>I&#8217;d much prefer to use the former if it doesn&#8217;t raise any coupling issues.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joni Ben-Ami</title>
		<link>http://www.udidahan.com/2009/06/14/domain-events-salvation/comment-page-2/#comment-36805</link>
		<dc:creator>Joni Ben-Ami</dc:creator>
		<pubDate>Wed, 21 Oct 2009 20:34:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.udidahan.com/?p=1029#comment-36805</guid>
		<description>Udi, 

I&#039;ve been deliberating this methodology as an alternative to having the service layer manage processes that include both domain changes and persistence. This tends to make the domain anemic, but implementing an ORM and a messaging infrastructure are currently not options.

But, following up on David&#039;s post and your reply (#83,84), would you consider it correct to say that using Domain Events is really only proper if you have the kind of transactional messaging infrastructure that you are talking about (MSMQ)?</description>
		<content:encoded><![CDATA[<p>Udi, </p>
<p>I&#8217;ve been deliberating this methodology as an alternative to having the service layer manage processes that include both domain changes and persistence. This tends to make the domain anemic, but implementing an ORM and a messaging infrastructure are currently not options.</p>
<p>But, following up on David&#8217;s post and your reply (#83,84), would you consider it correct to say that using Domain Events is really only proper if you have the kind of transactional messaging infrastructure that you are talking about (MSMQ)?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: udidahan</title>
		<link>http://www.udidahan.com/2009/06/14/domain-events-salvation/comment-page-2/#comment-36790</link>
		<dc:creator>udidahan</dc:creator>
		<pubDate>Mon, 12 Oct 2009 18:06:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.udidahan.com/?p=1029#comment-36790</guid>
		<description>Mohammad,

The actions bit is really only there for testing purposes. There isn&#039;t any practical difference between the two. Looks like it&#039;s time to refactor that out to a different role.</description>
		<content:encoded><![CDATA[<p>Mohammad,</p>
<p>The actions bit is really only there for testing purposes. There isn&#8217;t any practical difference between the two. Looks like it&#8217;s time to refactor that out to a different role.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mohammad Azam</title>
		<link>http://www.udidahan.com/2009/06/14/domain-events-salvation/comment-page-2/#comment-36789</link>
		<dc:creator>Mohammad Azam</dc:creator>
		<pubDate>Mon, 12 Oct 2009 17:23:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.udidahan.com/?p=1029#comment-36789</guid>
		<description>Hi Udi, 

Thanks for the reply! Actually my question is regarding the following code: 

 if (actions != null)
             foreach (var action in actions)
                  if (action is Action)
                      ((Action)action)(args);

What is the difference between the above code and the following code: 

 if (Container != null)
            foreach(var handler in Container.ResolveAll&lt;Handles&gt;())
                handler.Handle(args);

I think Actions is used for domain events and Handle are being used for service oriented events like sending out emails etc. 

Is that correct or am I missing something?</description>
		<content:encoded><![CDATA[<p>Hi Udi, </p>
<p>Thanks for the reply! Actually my question is regarding the following code: </p>
<p> if (actions != null)<br />
             foreach (var action in actions)<br />
                  if (action is Action)<br />
                      ((Action)action)(args);</p>
<p>What is the difference between the above code and the following code: </p>
<p> if (Container != null)<br />
            foreach(var handler in Container.ResolveAll&lt;Handles&gt;())<br />
                handler.Handle(args);</p>
<p>I think Actions is used for domain events and Handle are being used for service oriented events like sending out emails etc. </p>
<p>Is that correct or am I missing something?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
