<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.3.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: How to inject ORM with some IoC?</title>
	<link>http://rabdullin.com/how-to-inject-orm-with-some-ioc/</link>
	<description>Moving towards the efficient development of smart software solutions</description>
	<pubDate>Wed, 20 Aug 2008 13:59:13 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.2</generator>
		<item>
		<title>By: How to use ORM (XPO), IoC, C# 3.5 syntax, Linq and .NET 2.0 together? at Rinat Abdullin</title>
		<link>http://rabdullin.com/how-to-inject-orm-with-some-ioc/#comment-414</link>
		<dc:creator>How to use ORM (XPO), IoC, C# 3.5 syntax, Linq and .NET 2.0 together? at Rinat Abdullin</dc:creator>
		<pubDate>Sat, 08 Mar 2008 10:15:03 +0000</pubDate>
		<guid>http://rabdullin.com/how-to-inject-orm-with-some-ioc/#comment-414</guid>
		<description>[...] us get back to the IoC+ORM series and take one more look at the ICommand implementation from the last post. It could be improved quite a [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] us get back to the IoC+ORM series and take one more look at the ICommand implementation from the last post. It could be improved quite a [&#8230;]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeremy Gray</title>
		<link>http://rabdullin.com/how-to-inject-orm-with-some-ioc/#comment-404</link>
		<dc:creator>Jeremy Gray</dc:creator>
		<pubDate>Fri, 07 Mar 2008 03:35:56 +0000</pubDate>
		<guid>http://rabdullin.com/how-to-inject-orm-with-some-ioc/#comment-404</guid>
		<description>Hehe. Nice to see that I'm not the only one that has had this issue gnawing at me for ages. :)</description>
		<content:encoded><![CDATA[<p>Hehe. Nice to see that I&#8217;m not the only one that has had this issue gnawing at me for ages. :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rinat Abdullin</title>
		<link>http://rabdullin.com/how-to-inject-orm-with-some-ioc/#comment-403</link>
		<dc:creator>Rinat Abdullin</dc:creator>
		<pubDate>Fri, 07 Mar 2008 01:18:11 +0000</pubDate>
		<guid>http://rabdullin.com/how-to-inject-orm-with-some-ioc/#comment-403</guid>
		<description>Jeremy,

It was fun while the riddle lasted, but I think I've got the solution. 
And I like it))

I'll write the proper post tomorrow after another one that I've delayed for too long..</description>
		<content:encoded><![CDATA[<p>Jeremy,</p>
<p>It was fun while the riddle lasted, but I think I&#8217;ve got the solution.<br />
And I like it))</p>
<p>I&#8217;ll write the proper post tomorrow after another one that I&#8217;ve delayed for too long..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeremy Gray</title>
		<link>http://rabdullin.com/how-to-inject-orm-with-some-ioc/#comment-402</link>
		<dc:creator>Jeremy Gray</dc:creator>
		<pubDate>Fri, 07 Mar 2008 00:57:58 +0000</pubDate>
		<guid>http://rabdullin.com/how-to-inject-orm-with-some-ioc/#comment-402</guid>
		<description>Will do, and thanks for all the great posts. I'll definitely be keeping an eager eye on your blog to see how you do with XPO et al over time!</description>
		<content:encoded><![CDATA[<p>Will do, and thanks for all the great posts. I&#8217;ll definitely be keeping an eager eye on your blog to see how you do with XPO et al over time!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rinat Abdullin</title>
		<link>http://rabdullin.com/how-to-inject-orm-with-some-ioc/#comment-401</link>
		<dc:creator>Rinat Abdullin</dc:creator>
		<pubDate>Thu, 06 Mar 2008 22:20:51 +0000</pubDate>
		<guid>http://rabdullin.com/how-to-inject-orm-with-some-ioc/#comment-401</guid>
		<description>Jeremy,

I didn't say that I like this approach to much to move it into the xLim 2 body of knowledge)) The bit feels nice and promising, but there has to be more to it.

One of the probable solutions to the problem is to integrate IoC and DDD together. This bit will be quite complex and resource-consuming (multiply ORM by IoC) but if it has the proper dev team with experience in both worlds then it could live with that.

DevExpress folks are trying to achieve that by implementing their reusable domain models. But this looks too heavy for me.

There should be some other simple and logically beautiful solution, but we just do not see it yet...

Good luck with your search and, please, do not hesitate to share your findings))

Best regards,
Rinat Abdullin</description>
		<content:encoded><![CDATA[<p>Jeremy,</p>
<p>I didn&#8217;t say that I like this approach to much to move it into the xLim 2 body of knowledge)) The bit feels nice and promising, but there has to be more to it.</p>
<p>One of the probable solutions to the problem is to integrate IoC and DDD together. This bit will be quite complex and resource-consuming (multiply ORM by IoC) but if it has the proper dev team with experience in both worlds then it could live with that.</p>
<p>DevExpress folks are trying to achieve that by implementing their reusable domain models. But this looks too heavy for me.</p>
<p>There should be some other simple and logically beautiful solution, but we just do not see it yet&#8230;</p>
<p>Good luck with your search and, please, do not hesitate to share your findings))</p>
<p>Best regards,<br />
Rinat Abdullin</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeremy Gray</title>
		<link>http://rabdullin.com/how-to-inject-orm-with-some-ioc/#comment-398</link>
		<dc:creator>Jeremy Gray</dc:creator>
		<pubDate>Thu, 06 Mar 2008 20:17:01 +0000</pubDate>
		<guid>http://rabdullin.com/how-to-inject-orm-with-some-ioc/#comment-398</guid>
		<description>The problem with the approach you like is that it can't be unit-tested. The (admitted) problem with the approach you do not like is that (as many others have pointed out over the years) serviced entities just "feel" weird, and can definitely add overhead depending on injection techniques used. I do admit that I am still searching for a way to both have good DDD (which means zero anemic domain model anti-pattern effects) and good abstraction (primarily for testability, but also for more subjective general design quality improvements) at the same time.

Every time the subject comes up across the blogosphere, however, it becomes pretty clear that people are choosing _between_ the two. They are either having good DDD, but are more tightly coupled, less abstracted, and have testing issues, or they are having good loose coupling, beter abstractions, and better testing, but are doing so at the cost of heading towards anemic domain models and Fowler-esque "transaction script"-style services.

Perhaps one of these days we'll have both. I'm going to try to force this to happen on my next pet project just to see how things go. If I come up with anything interesting, I'll be sure to mention it. :) In the meantime, I'll be continuing my already-years-long search for a solution.</description>
		<content:encoded><![CDATA[<p>The problem with the approach you like is that it can&#8217;t be unit-tested. The (admitted) problem with the approach you do not like is that (as many others have pointed out over the years) serviced entities just &#8220;feel&#8221; weird, and can definitely add overhead depending on injection techniques used. I do admit that I am still searching for a way to both have good DDD (which means zero anemic domain model anti-pattern effects) and good abstraction (primarily for testability, but also for more subjective general design quality improvements) at the same time.</p>
<p>Every time the subject comes up across the blogosphere, however, it becomes pretty clear that people are choosing _between_ the two. They are either having good DDD, but are more tightly coupled, less abstracted, and have testing issues, or they are having good loose coupling, beter abstractions, and better testing, but are doing so at the cost of heading towards anemic domain models and Fowler-esque &#8220;transaction script&#8221;-style services.</p>
<p>Perhaps one of these days we&#8217;ll have both. I&#8217;m going to try to force this to happen on my next pet project just to see how things go. If I come up with anything interesting, I&#8217;ll be sure to mention it. :) In the meantime, I&#8217;ll be continuing my already-years-long search for a solution.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rinat Abdullin</title>
		<link>http://rabdullin.com/how-to-inject-orm-with-some-ioc/#comment-397</link>
		<dc:creator>Rinat Abdullin</dc:creator>
		<pubDate>Thu, 06 Mar 2008 19:17:59 +0000</pubDate>
		<guid>http://rabdullin.com/how-to-inject-orm-with-some-ioc/#comment-397</guid>
		<description>Jeremy, 

I knew that you would ask - see the last bullet-note in this article))

Simple brute-force solution is:
1) pull everything to the IAccount interface (including Save method, repeat for other BOs...)
2) register Account as IAccount and keep the existing Account registration as type (session will need it since it has to do some low-level work).
3) wrap the enumerator of the FireCollection with interface explicit implementation that returns IAccount (and do that for any other members that you need to use).

Then, you could ask IoC for IRepository{IAccount} or use IAccount to create new instances.

But I neither like this approach nor advice it - the objects will have to travel back from IAccount to Account inside the actual implementation, and that just does not feel right.

That's why I haven't mentioned this approach in the primary post.

Rinat</description>
		<content:encoded><![CDATA[<p>Jeremy, </p>
<p>I knew that you would ask - see the last bullet-note in this article))</p>
<p>Simple brute-force solution is:<br />
1) pull everything to the IAccount interface (including Save method, repeat for other BOs&#8230;)<br />
2) register Account as IAccount and keep the existing Account registration as type (session will need it since it has to do some low-level work).<br />
3) wrap the enumerator of the FireCollection with interface explicit implementation that returns IAccount (and do that for any other members that you need to use).</p>
<p>Then, you could ask IoC for IRepository{IAccount} or use IAccount to create new instances.</p>
<p>But I neither like this approach nor advice it - the objects will have to travel back from IAccount to Account inside the actual implementation, and that just does not feel right.</p>
<p>That&#8217;s why I haven&#8217;t mentioned this approach in the primary post.</p>
<p>Rinat</p>
]]></content:encoded>
	</item>
</channel>
</rss>
