<?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: CQRS &#224; la Greg Young</title>
	<atom:link href="http://elegantcode.com/2009/11/11/cqrs-la-greg-young/feed/" rel="self" type="application/rss+xml" />
	<link>http://elegantcode.com/2009/11/11/cqrs-la-greg-young/</link>
	<description></description>
	<lastBuildDate>Mon, 15 Mar 2010 21:03:20 -0500</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Mark Nijhof</title>
		<link>http://elegantcode.com/2009/11/11/cqrs-la-greg-young/comment-page-4/#comment-53496</link>
		<dc:creator>Mark Nijhof</dc:creator>
		<pubDate>Tue, 09 Feb 2010 17:26:22 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2009/11/11/cqrs-la-greg-young/#comment-53496</guid>
		<description>&lt;a href=&quot;#comment-53495&quot; rel=&quot;nofollow&quot;&gt;@Ertugrul&lt;/a&gt; 
You are correct the Event Store is INSERT and READ only, no events will ever be changed or deleted. But an Aggregate Root would not get a repository to retrieve another Aggregate Root from the Event Store. But an Aggregate can contain other Entities if that is needed for domain behavior, but these are then &#039;managed&#039; by the Aggregate Root and retrieved by retrieving the Aggregate Root. If you need state from other Aggregate Roots then you would use a service that uses the reporting repository to query the reporting side for this state, this is because the domain repository can only retrieve by Id, so no querying.

Hope that helps.</description>
		<content:encoded><![CDATA[<p><a href="#comment-53495" rel="nofollow">@Ertugrul</a><br />
You are correct the Event Store is INSERT and READ only, no events will ever be changed or deleted. But an Aggregate Root would not get a repository to retrieve another Aggregate Root from the Event Store. But an Aggregate can contain other Entities if that is needed for domain behavior, but these are then &#8216;managed&#8217; by the Aggregate Root and retrieved by retrieving the Aggregate Root. If you need state from other Aggregate Roots then you would use a service that uses the reporting repository to query the reporting side for this state, this is because the domain repository can only retrieve by Id, so no querying.</p>
<p>Hope that helps.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ertugrul</title>
		<link>http://elegantcode.com/2009/11/11/cqrs-la-greg-young/comment-page-4/#comment-53495</link>
		<dc:creator>Ertugrul</dc:creator>
		<pubDate>Tue, 09 Feb 2010 14:38:44 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2009/11/11/cqrs-la-greg-young/#comment-53495</guid>
		<description>Hi, it looks like there is an arrow from the &quot;Event Store&quot; back to the &quot;Repository&quot; and another one labeled &quot;Aggregate&quot; from &quot;Repository&quot; to the &quot;Domain Model&quot;. Then the Event Store is INSERT and READ only but not &quot;write only&quot;?
Does this mean that we are actually retrieving other Aggregates from the repository by not &quot;querying&quot; but by recreating them from the event store via the Repository, whenever we need them during Domain Logic?</description>
		<content:encoded><![CDATA[<p>Hi, it looks like there is an arrow from the &#8220;Event Store&#8221; back to the &#8220;Repository&#8221; and another one labeled &#8220;Aggregate&#8221; from &#8220;Repository&#8221; to the &#8220;Domain Model&#8221;. Then the Event Store is INSERT and READ only but not &#8220;write only&#8221;?<br />
Does this mean that we are actually retrieving other Aggregates from the repository by not &#8220;querying&#8221; but by recreating them from the event store via the Repository, whenever we need them during Domain Logic?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Nijhof</title>
		<link>http://elegantcode.com/2009/11/11/cqrs-la-greg-young/comment-page-4/#comment-53450</link>
		<dc:creator>Mark Nijhof</dc:creator>
		<pubDate>Sun, 07 Feb 2010 18:31:44 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2009/11/11/cqrs-la-greg-young/#comment-53450</guid>
		<description>&lt;a href=&quot;#comment-53148&quot; rel=&quot;nofollow&quot;&gt;@marko&lt;/a&gt; 
Sorry for the late reply, your post got somewhat forgotten :)

In this case you could choose to implement a view model that assumes certain behavior from the domain. So it will do some basic checks to verify that the command is ok, then after sending the command and receiving a OK back (command either receive an Ok or Exception back) it assumes that the order is added and it will add it to its local representation of the list with orders (if it matches the filter criteria).

But to be honest there are other options as well all depending on how critical it is that you need the last data in each client vs only the client that submitted it. Anyway surely a whole new post ;)

Hope this helps.</description>
		<content:encoded><![CDATA[<p><a href="#comment-53148" rel="nofollow">@marko</a><br />
Sorry for the late reply, your post got somewhat forgotten <img src='http://elegantcode.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>In this case you could choose to implement a view model that assumes certain behavior from the domain. So it will do some basic checks to verify that the command is ok, then after sending the command and receiving a OK back (command either receive an Ok or Exception back) it assumes that the order is added and it will add it to its local representation of the list with orders (if it matches the filter criteria).</p>
<p>But to be honest there are other options as well all depending on how critical it is that you need the last data in each client vs only the client that submitted it. Anyway surely a whole new post <img src='http://elegantcode.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Hope this helps.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: DDDSample 0.6 &#171; Simon says&#8230; architecture!</title>
		<link>http://elegantcode.com/2009/11/11/cqrs-la-greg-young/comment-page-4/#comment-53218</link>
		<dc:creator>DDDSample 0.6 &#171; Simon says&#8230; architecture!</dc:creator>
		<pubDate>Fri, 29 Jan 2010 06:32:11 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2009/11/11/cqrs-la-greg-young/#comment-53218</guid>
		<description>[...] implementation. The most import ones come from Udi Dahan and Greg Young (which is best described by Mark Nijhof). My own implementation is somewhat close to Udi&#8217;s ideas (at least I hope so;-). What I [...]</description>
		<content:encoded><![CDATA[<p>[...] implementation. The most import ones come from Udi Dahan and Greg Young (which is best described by Mark Nijhof). My own implementation is somewhat close to Udi&#8217;s ideas (at least I hope so;-). What I [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Nijhof</title>
		<link>http://elegantcode.com/2009/11/11/cqrs-la-greg-young/comment-page-4/#comment-53203</link>
		<dc:creator>Mark Nijhof</dc:creator>
		<pubDate>Thu, 28 Jan 2010 18:11:10 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2009/11/11/cqrs-la-greg-young/#comment-53203</guid>
		<description>&lt;a href=&quot;#comment-53201&quot; rel=&quot;nofollow&quot;&gt;@John Davidson&lt;/a&gt; 
Sure I can and I believe my reply was arguing his point of view in the exact same manner as he was making his point. Btw you know your IP is being recorded Mr_Simple?</description>
		<content:encoded><![CDATA[<p><a href="#comment-53201" rel="nofollow">@John Davidson</a><br />
Sure I can and I believe my reply was arguing his point of view in the exact same manner as he was making his point. Btw you know your IP is being recorded Mr_Simple?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Davidson</title>
		<link>http://elegantcode.com/2009/11/11/cqrs-la-greg-young/comment-page-4/#comment-53201</link>
		<dc:creator>John Davidson</dc:creator>
		<pubDate>Thu, 28 Jan 2010 18:00:04 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2009/11/11/cqrs-la-greg-young/#comment-53201</guid>
		<description>Apparently you can&#039;t take rational, justified, discussion that may not agree with your position.  Mr_Simple was simply stating good luck finding a client that will pay you to program this heavyweight solution.</description>
		<content:encoded><![CDATA[<p>Apparently you can&#8217;t take rational, justified, discussion that may not agree with your position.  Mr_Simple was simply stating good luck finding a client that will pay you to program this heavyweight solution.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: marko</title>
		<link>http://elegantcode.com/2009/11/11/cqrs-la-greg-young/comment-page-4/#comment-53148</link>
		<dc:creator>marko</dc:creator>
		<pubDate>Wed, 27 Jan 2010 22:33:53 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2009/11/11/cqrs-la-greg-young/#comment-53148</guid>
		<description>&gt;&gt; But when you system starts to grow you might get some performance problems and then you could start by implementing a bus disconnecting the publishing of the events and handling of these events. This means that it is possible and likely that your event store and reporting database are not completely in sync with each other, they are eventual consistent. Which means that it is possible that the user sees old data on his screens.

&gt;&gt; Depending on how critical this really is you can have different counter measures for this, which I will be going into in a different post as this is also not something the example provides.

Mark, I apologize if you have already discussed this as part of a newer post, but wonder how you handle the eventual consistency issue for cases where it&#039;s difficult to be tolerant of any delay?

I&#039;m particularly thinking of this use-case....

User is displaying a list of objects (eg. Orders), that are filtered in non-trivial way (eg. all Orders in a certain status, over a particular date range, etc...).  The list would be rendered using the reporting db.  

Now the user creates a new Order or Modifies an existing one from the list, then saves it to the domain model.  If it update is successful, the screen is to render the list of filtered Orders, which should include the new/modified Order if it matches the filter.

It seems like the UI will have to immediately see the domain model change in the UI database?

What would be appropriate way to handle this situation?

Thanks Mark.

Marko.
.</description>
		<content:encoded><![CDATA[<p>&gt;&gt; But when you system starts to grow you might get some performance problems and then you could start by implementing a bus disconnecting the publishing of the events and handling of these events. This means that it is possible and likely that your event store and reporting database are not completely in sync with each other, they are eventual consistent. Which means that it is possible that the user sees old data on his screens.</p>
<p>&gt;&gt; Depending on how critical this really is you can have different counter measures for this, which I will be going into in a different post as this is also not something the example provides.</p>
<p>Mark, I apologize if you have already discussed this as part of a newer post, but wonder how you handle the eventual consistency issue for cases where it&#8217;s difficult to be tolerant of any delay?</p>
<p>I&#8217;m particularly thinking of this use-case&#8230;.</p>
<p>User is displaying a list of objects (eg. Orders), that are filtered in non-trivial way (eg. all Orders in a certain status, over a particular date range, etc&#8230;).  The list would be rendered using the reporting db.  </p>
<p>Now the user creates a new Order or Modifies an existing one from the list, then saves it to the domain model.  If it update is successful, the screen is to render the list of filtered Orders, which should include the new/modified Order if it matches the filter.</p>
<p>It seems like the UI will have to immediately see the domain model change in the UI database?</p>
<p>What would be appropriate way to handle this situation?</p>
<p>Thanks Mark.</p>
<p>Marko.<br />
.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Nijhof</title>
		<link>http://elegantcode.com/2009/11/11/cqrs-la-greg-young/comment-page-4/#comment-53131</link>
		<dc:creator>Mark Nijhof</dc:creator>
		<pubDate>Wed, 27 Jan 2010 09:54:40 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2009/11/11/cqrs-la-greg-young/#comment-53131</guid>
		<description>&lt;a href=&quot;#comment-53128&quot; rel=&quot;nofollow&quot;&gt;@Mr_Simple&lt;/a&gt; 
Apparently you didn&#039;t understand everything perfectly, because if you did you would have seen that this really isn&#039;t gold plated programming, but that there are actual business reasons behind the whole architecture pattern. So yes when you have business needs that this pattern solves for you then there are clients that pay for it. Something that isn&#039;t really difficult to understand all together. And hey the code works without the unit tests, so if you feel you don&#039;t have to write them, then please don&#039;t.

It is too bad you left a fake name and e-mail address else we could see if we had such a client for you indeed, all-do with this attitude I doubt they would trust you to do a good job.</description>
		<content:encoded><![CDATA[<p><a href="#comment-53128" rel="nofollow">@Mr_Simple</a><br />
Apparently you didn&#8217;t understand everything perfectly, because if you did you would have seen that this really isn&#8217;t gold plated programming, but that there are actual business reasons behind the whole architecture pattern. So yes when you have business needs that this pattern solves for you then there are clients that pay for it. Something that isn&#8217;t really difficult to understand all together. And hey the code works without the unit tests, so if you feel you don&#8217;t have to write them, then please don&#8217;t.</p>
<p>It is too bad you left a fake name and e-mail address else we could see if we had such a client for you indeed, all-do with this attitude I doubt they would trust you to do a good job.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mr_Simple</title>
		<link>http://elegantcode.com/2009/11/11/cqrs-la-greg-young/comment-page-3/#comment-53128</link>
		<dc:creator>Mr_Simple</dc:creator>
		<pubDate>Wed, 27 Jan 2010 03:19:26 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2009/11/11/cqrs-la-greg-young/#comment-53128</guid>
		<description>I understand everything perfectly, but do you actually have clients that will pay you (or give you the time) to write the zillion lines of code (and unit tests, and documentation) and explain to the junior programmers you will be handing off to how all this stuff works?

Man we&#039;re talking about turning 40 hours of normal high quality work into 60 hours of gold plated programming.  Yahoo!  Gimme that client!</description>
		<content:encoded><![CDATA[<p>I understand everything perfectly, but do you actually have clients that will pay you (or give you the time) to write the zillion lines of code (and unit tests, and documentation) and explain to the junior programmers you will be handing off to how all this stuff works?</p>
<p>Man we&#8217;re talking about turning 40 hours of normal high quality work into 60 hours of gold plated programming.  Yahoo!  Gimme that client!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Nijhof</title>
		<link>http://elegantcode.com/2009/11/11/cqrs-la-greg-young/comment-page-3/#comment-53071</link>
		<dc:creator>Mark Nijhof</dc:creator>
		<pubDate>Sun, 24 Jan 2010 18:31:56 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2009/11/11/cqrs-la-greg-young/#comment-53071</guid>
		<description>&lt;a href=&quot;#comment-52937&quot; rel=&quot;nofollow&quot;&gt;@Erik&lt;/a&gt; 
I am not sure what you mean by parameters? You mean the data in the events? Well those can be (and I would do that next time) be value objects. But I don&#039;t see then being domain objects as in Entities and such as that would default the purpose of having a write only domain. An event is only a POCO so no behavior.

&lt;a href=&quot;#comment-53068&quot; rel=&quot;nofollow&quot;&gt;@Nigel King&lt;/a&gt; 
Well with Event Sourcing each event will be persisted, but they are not serialized to fields in a DB, instead the whole event is serialized into a single column in the DB. Each different event type shares the same table and column for this. Indeed AR Id and Event Version are what makes it unique, but when using GUID as AR Id then you don&#039;t need the version. However I guess it would help speed up the event retrieval.

Hope this helps.</description>
		<content:encoded><![CDATA[<p><a href="#comment-52937" rel="nofollow">@Erik</a><br />
I am not sure what you mean by parameters? You mean the data in the events? Well those can be (and I would do that next time) be value objects. But I don&#8217;t see then being domain objects as in Entities and such as that would default the purpose of having a write only domain. An event is only a POCO so no behavior.</p>
<p><a href="#comment-53068" rel="nofollow">@Nigel King</a><br />
Well with Event Sourcing each event will be persisted, but they are not serialized to fields in a DB, instead the whole event is serialized into a single column in the DB. Each different event type shares the same table and column for this. Indeed AR Id and Event Version are what makes it unique, but when using GUID as AR Id then you don&#8217;t need the version. However I guess it would help speed up the event retrieval.</p>
<p>Hope this helps.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
