<?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: Repositories don&#8217;t have save methods</title>
	<atom:link href="http://richarddingwall.name/2009/10/22/repositories-dont-have-save-methods/feed/" rel="self" type="application/rss+xml" />
	<link>http://richarddingwall.name/2009/10/22/repositories-dont-have-save-methods/</link>
	<description>Adventures of a young kiwi software developer in London</description>
	<lastBuildDate>Tue, 09 Mar 2010 23:02:54 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Rohland</title>
		<link>http://richarddingwall.name/2009/10/22/repositories-dont-have-save-methods/comment-page-1/#comment-11198</link>
		<dc:creator>Rohland</dc:creator>
		<pubDate>Mon, 26 Oct 2009 07:33:20 +0000</pubDate>
		<guid isPermaLink="false">http://richarddingwall.name/?p=2350#comment-11198</guid>
		<description>Richard, in many cases you need to explicitly force an update as part of a larger unit of work. I am not sure if I prefer the SubmitChanges approach as implemented with LINQ to SQL.

For example, I don&#039;t enjoy having to pass the data context to each repository. Obviously, you could implement some kind of IOC container so you don&#039;t deal with the binding explicitly but when I have tried this in the past I have run into some weird runtime issues. Case in point - the LoadWith option in LINQ to SQL just doesn&#039;t really work if you implement this kind of pattern because the options need to be set before the context is first utilised. This causes a headache in terms of lifetime management of the data context.

I have been using LLBLGEN for the past 6 months or so and have really been impressed with the library. Granted, my repositories have a &quot;Save&quot; method, but I am not sure if this is such a big issue.</description>
		<content:encoded><![CDATA[<p>Richard, in many cases you need to explicitly force an update as part of a larger unit of work. I am not sure if I prefer the SubmitChanges approach as implemented with LINQ to SQL.</p>
<p>For example, I don&#8217;t enjoy having to pass the data context to each repository. Obviously, you could implement some kind of IOC container so you don&#8217;t deal with the binding explicitly but when I have tried this in the past I have run into some weird runtime issues. Case in point &#8211; the LoadWith option in LINQ to SQL just doesn&#8217;t really work if you implement this kind of pattern because the options need to be set before the context is first utilised. This causes a headache in terms of lifetime management of the data context.</p>
<p>I have been using LLBLGEN for the past 6 months or so and have really been impressed with the library. Granted, my repositories have a &#8220;Save&#8221; method, but I am not sure if this is such a big issue.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt Freeman</title>
		<link>http://richarddingwall.name/2009/10/22/repositories-dont-have-save-methods/comment-page-1/#comment-11157</link>
		<dc:creator>Matt Freeman</dc:creator>
		<pubDate>Sat, 24 Oct 2009 06:38:28 +0000</pubDate>
		<guid isPermaLink="false">http://richarddingwall.name/?p=2350#comment-11157</guid>
		<description>I think I agree, although I have no yet adopted this approach myself, it should be a simple refactor.  Infact my save method is pretty dumb since when the UOW is commited any dirty entities are flushed via nhibernate.</description>
		<content:encoded><![CDATA[<p>I think I agree, although I have no yet adopted this approach myself, it should be a simple refactor.  Infact my save method is pretty dumb since when the UOW is commited any dirty entities are flushed via nhibernate.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Richard</title>
		<link>http://richarddingwall.name/2009/10/22/repositories-dont-have-save-methods/comment-page-1/#comment-11154</link>
		<dc:creator>Richard</dc:creator>
		<pubDate>Fri, 23 Oct 2009 21:48:26 +0000</pubDate>
		<guid isPermaLink="false">http://richarddingwall.name/?p=2350#comment-11154</guid>
		<description>Mike: save is a frequently used term but so is login. Unless your domain is a document editor or security gateway, both are application concepts, not part of the domain model.</description>
		<content:encoded><![CDATA[<p>Mike: save is a frequently used term but so is login. Unless your domain is a document editor or security gateway, both are application concepts, not part of the domain model.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Richard</title>
		<link>http://richarddingwall.name/2009/10/22/repositories-dont-have-save-methods/comment-page-1/#comment-11153</link>
		<dc:creator>Richard</dc:creator>
		<pubDate>Fri, 23 Oct 2009 21:44:17 +0000</pubDate>
		<guid isPermaLink="false">http://richarddingwall.name/?p=2350#comment-11153</guid>
		<description>Rohland and Mathias: Add is just add, you only call it the first time an entity is made persistent. Updates to existing objects are handled via the unit of work; it keeps track of all loaded entities and at the end it looks for any that changed and saves them. 

Both NHibernate&#039;s ISession and Linq-to-SQL&#039;s DataContext implement this pattern.</description>
		<content:encoded><![CDATA[<p>Rohland and Mathias: Add is just add, you only call it the first time an entity is made persistent. Updates to existing objects are handled via the unit of work; it keeps track of all loaded entities and at the end it looks for any that changed and saves them. </p>
<p>Both NHibernate&#8217;s ISession and Linq-to-SQL&#8217;s DataContext implement this pattern.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mathias</title>
		<link>http://richarddingwall.name/2009/10/22/repositories-dont-have-save-methods/comment-page-1/#comment-11151</link>
		<dc:creator>Mathias</dc:creator>
		<pubDate>Fri, 23 Oct 2009 21:26:07 +0000</pubDate>
		<guid isPermaLink="false">http://richarddingwall.name/?p=2350#comment-11151</guid>
		<description>+1 to Rohland&#039;s question! Is your Add an &quot;Add or Replace&quot;, and if not, how do you handle updates?</description>
		<content:encoded><![CDATA[<p>+1 to Rohland&#8217;s question! Is your Add an &#8220;Add or Replace&#8221;, and if not, how do you handle updates?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike</title>
		<link>http://richarddingwall.name/2009/10/22/repositories-dont-have-save-methods/comment-page-1/#comment-11147</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Fri, 23 Oct 2009 14:20:31 +0000</pubDate>
		<guid isPermaLink="false">http://richarddingwall.name/?p=2350#comment-11147</guid>
		<description>I agree mostly but sometimes &quot;Save&quot; is part of the ubiquitous language everyone agrees to.</description>
		<content:encoded><![CDATA[<p>I agree mostly but sometimes &#8220;Save&#8221; is part of the ubiquitous language everyone agrees to.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rohland</title>
		<link>http://richarddingwall.name/2009/10/22/repositories-dont-have-save-methods/comment-page-1/#comment-11141</link>
		<dc:creator>Rohland</dc:creator>
		<pubDate>Fri, 23 Oct 2009 08:57:06 +0000</pubDate>
		<guid isPermaLink="false">http://richarddingwall.name/?p=2350#comment-11141</guid>
		<description>Hi Richard,

Just interested, how would you implement the update mechanism in this case?

Cheers,
Rohland</description>
		<content:encoded><![CDATA[<p>Hi Richard,</p>
<p>Just interested, how would you implement the update mechanism in this case?</p>
<p>Cheers,<br />
Rohland</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Reflective Perspective - Chris Alcock &#187; The Morning Brew #461</title>
		<link>http://richarddingwall.name/2009/10/22/repositories-dont-have-save-methods/comment-page-1/#comment-11138</link>
		<dc:creator>Reflective Perspective - Chris Alcock &#187; The Morning Brew #461</dc:creator>
		<pubDate>Fri, 23 Oct 2009 07:37:53 +0000</pubDate>
		<guid isPermaLink="false">http://richarddingwall.name/?p=2350#comment-11138</guid>
		<description>[...] Repositories don&#8217;t have save methods - Richard Dingwall argues that a correct DDD style repository does not have a save method, and should instead have a collection like interface, meaning Add is more appropriate [...]</description>
		<content:encoded><![CDATA[<p>[...] Repositories don&#8217;t have save methods &#8211; Richard Dingwall argues that a correct DDD style repository does not have a save method, and should instead have a collection like interface, meaning Add is more appropriate [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
