<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
<channel>
	<title>Comments for The Inquisitive Coder - Davy Brion's Blog</title>
	
	<link>http://davybrion.com/blog</link>
	<description>Trying to walk that thin line between intelligence and ignorance</description>
	<lastBuildDate>Mon, 09 Nov 2009 00:08:10 -0800</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/davybrioncomments" type="application/rss+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
		<title>Comment on Request/Response Service Layer: Requests And Responses by Aaron Fischer</title>
		<link>http://feedproxy.google.com/~r/davybrioncomments/~3/pHVeZMLkwoA/</link>
		<dc:creator>Aaron Fischer</dc:creator>
		<pubDate>Mon, 09 Nov 2009 00:08:10 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=1796#comment-22892</guid>
		<description>Why pass the exception parameters in every response?  Since you have OO, you can return a strongly typed ErrorResponse.</description>
		<content:encoded><![CDATA[<p>Why pass the exception parameters in every response?  Since you have OO, you can return a strongly typed ErrorResponse.</p>
<img src="http://feeds.feedburner.com/~r/davybrioncomments/~4/pHVeZMLkwoA" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://davybrion.com/blog/2009/11/requestresponse-service-layer-requests-and-responses/comment-page-1/#comment-22892</feedburner:origLink></item>
	<item>
		<title>Comment on Why I Dislike Classic Or Typical WCF Usage by Request/Response Service Layer Series | The Inquisitive Coder – Davy Brion’s Blog</title>
		<link>http://feedproxy.google.com/~r/davybrioncomments/~3/R8u3GRYKNOE/</link>
		<dc:creator>Request/Response Service Layer Series | The Inquisitive Coder – Davy Brion’s Blog</dc:creator>
		<pubDate>Sun, 08 Nov 2009 12:16:44 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=1453#comment-22890</guid>
		<description>[...] wrote a post a couple of months ago to discuss what i dislike about typical/classic WCF services and how the [...]</description>
		<content:encoded><![CDATA[<p>[...] wrote a post a couple of months ago to discuss what i dislike about typical/classic WCF services and how the [...]</p>
<img src="http://feeds.feedburner.com/~r/davybrioncomments/~4/R8u3GRYKNOE" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://davybrion.com/blog/2009/07/why-i-dislike-classic-or-typical-wcf-usage/comment-page-1/#comment-22890</feedburner:origLink></item>
	<item>
		<title>Comment on Why I Don’t Use Twitter by Mike</title>
		<link>http://feedproxy.google.com/~r/davybrioncomments/~3/Zm8g9xl-YTQ/</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Sun, 08 Nov 2009 03:15:26 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=1870#comment-22889</guid>
		<description>This is why I use tweetdeck with search columns. I only see stuff with hash tags that I am interested in...it cuts out the majority of the crap that I don't care about and lets me focus on stuff I am interested in. I used to think twitter was totally worthless, but using it this way has made it worthwhile for me.</description>
		<content:encoded><![CDATA[<p>This is why I use tweetdeck with search columns. I only see stuff with hash tags that I am interested in&#8230;it cuts out the majority of the crap that I don&#8217;t care about and lets me focus on stuff I am interested in. I used to think twitter was totally worthless, but using it this way has made it worthwhile for me.</p>
<img src="http://feeds.feedburner.com/~r/davybrioncomments/~4/Zm8g9xl-YTQ" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://davybrion.com/blog/2009/11/why-i-dont-use-twitter/comment-page-1/#comment-22889</feedburner:origLink></item>
	<item>
		<title>Comment on Why I Don’t Use Twitter by Danny</title>
		<link>http://feedproxy.google.com/~r/davybrioncomments/~3/u5FXOL3__VE/</link>
		<dc:creator>Danny</dc:creator>
		<pubDate>Sun, 08 Nov 2009 02:42:07 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=1870#comment-22887</guid>
		<description>Twitter is ok but you have to be careful with who you follow.  The first subscriptions to be kicked out of my Google Reader are the ones that update about 20 times a day, so as you can imagine I end up only following quiet people on Twitter.  My friends are pretty good, but programmers such as ayende, scott guthrie, haacked etc just bang on all day like little girls so you have to unsubscribe.

So yes what you said.</description>
		<content:encoded><![CDATA[<p>Twitter is ok but you have to be careful with who you follow.  The first subscriptions to be kicked out of my Google Reader are the ones that update about 20 times a day, so as you can imagine I end up only following quiet people on Twitter.  My friends are pretty good, but programmers such as ayende, scott guthrie, haacked etc just bang on all day like little girls so you have to unsubscribe.</p>
<p>So yes what you said.</p>
<img src="http://feeds.feedburner.com/~r/davybrioncomments/~4/u5FXOL3__VE" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://davybrion.com/blog/2009/11/why-i-dont-use-twitter/comment-page-1/#comment-22887</feedburner:origLink></item>
	<item>
		<title>Comment on Why I Don’t Use Twitter by Justin Etheredge</title>
		<link>http://feedproxy.google.com/~r/davybrioncomments/~3/g5uAFblGozI/</link>
		<dc:creator>Justin Etheredge</dc:creator>
		<pubDate>Sat, 07 Nov 2009 22:42:22 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=1870#comment-22885</guid>
		<description>Get off my lawn! :-)

@JustinEtheredge</description>
		<content:encoded><![CDATA[<p>Get off my lawn! <img src='http://davybrion.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>@JustinEtheredge</p>
<img src="http://feeds.feedburner.com/~r/davybrioncomments/~4/g5uAFblGozI" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://davybrion.com/blog/2009/11/why-i-dont-use-twitter/comment-page-1/#comment-22885</feedburner:origLink></item>
	<item>
		<title>Comment on Why I Don’t Use Twitter by Michel Grootjans</title>
		<link>http://feedproxy.google.com/~r/davybrioncomments/~3/-ACadJiG2Yc/</link>
		<dc:creator>Michel Grootjans</dc:creator>
		<pubDate>Sat, 07 Nov 2009 20:48:36 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=1870#comment-22884</guid>
		<description>RT @DavyBrion: Why I Don't Use Twitter ;-)</description>
		<content:encoded><![CDATA[<p>RT @DavyBrion: Why I Don&#8217;t Use Twitter <img src='http://davybrion.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<img src="http://feeds.feedburner.com/~r/davybrioncomments/~4/-ACadJiG2Yc" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://davybrion.com/blog/2009/11/why-i-dont-use-twitter/comment-page-1/#comment-22884</feedburner:origLink></item>
	<item>
		<title>Comment on At This Point, I’d Prefer Java Developers Over .NET Developers by Goh</title>
		<link>http://feedproxy.google.com/~r/davybrioncomments/~3/gcEXSIO9jho/</link>
		<dc:creator>Goh</dc:creator>
		<pubDate>Thu, 05 Nov 2009 11:23:54 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=1336#comment-22882</guid>
		<description>I am .Net developer and used to work in a java-based company. I heard a lot of complain about microsoft and .net everyday from java developers. I think sometime they just too bias. What we really need is an application which really work regardless of what design pattern we are using. I left the java based company after a year and developed my own application (similar solution) which is running fully in ASP.Net. Now I have more than thousands companies using my application in a single server. My ex-company? still struggling on how to process the transactions faster. The fact is, my application is developed by my friend (now my partner) and I, and my ex-company application is developed with more than 10 java developers and 1 of them already have 13 years experience in java. I had proven .net can be better than java and it really depends on how you design the system. Bear in mind, i am just a 2 years experience .net developer that time and i know very little about the design concept as mentioned by Brion.</description>
		<content:encoded><![CDATA[<p>I am .Net developer and used to work in a java-based company. I heard a lot of complain about microsoft and .net everyday from java developers. I think sometime they just too bias. What we really need is an application which really work regardless of what design pattern we are using. I left the java based company after a year and developed my own application (similar solution) which is running fully in ASP.Net. Now I have more than thousands companies using my application in a single server. My ex-company? still struggling on how to process the transactions faster. The fact is, my application is developed by my friend (now my partner) and I, and my ex-company application is developed with more than 10 java developers and 1 of them already have 13 years experience in java. I had proven .net can be better than java and it really depends on how you design the system. Bear in mind, i am just a 2 years experience .net developer that time and i know very little about the design concept as mentioned by Brion.</p>
<img src="http://feeds.feedburner.com/~r/davybrioncomments/~4/gcEXSIO9jho" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://davybrion.com/blog/2009/04/at-this-point-id-prefer-java-developers-over-net-developers/comment-page-2/#comment-22882</feedburner:origLink></item>
	<item>
		<title>Comment on Integrated Security With Silverlight And WCF by Dave</title>
		<link>http://feedproxy.google.com/~r/davybrioncomments/~3/1ni-yMwmrgQ/</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Thu, 05 Nov 2009 05:52:09 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=1856#comment-22881</guid>
		<description>We've been using this method since before SL3 came out, so I can confirm it works with SL2.</description>
		<content:encoded><![CDATA[<p>We&#8217;ve been using this method since before SL3 came out, so I can confirm it works with SL2.</p>
<img src="http://feeds.feedburner.com/~r/davybrioncomments/~4/1ni-yMwmrgQ" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://davybrion.com/blog/2009/11/integrated-security-with-silverlight-and-wcf/comment-page-1/#comment-22881</feedburner:origLink></item>
	<item>
		<title>Comment on Constructor Injection vs Setter Injection by TomC</title>
		<link>http://feedproxy.google.com/~r/davybrioncomments/~3/L6UmbVYd1OE/</link>
		<dc:creator>TomC</dc:creator>
		<pubDate>Wed, 04 Nov 2009 09:10:37 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=1715#comment-22880</guid>
		<description>@Jeremy

The solution you provided, doesn't seem like a very good solution to me. 
By doing this, the RequestProcessor (the one who resolves the RequestHandlers and calls their Handle method) would have to know which types have a Handle method with a UnitOfWork and which don't, probably resulting in an if-cast and at least 2 different ways to call a RequestHandler. If for some reason another type of RequestHandler is introduced it would result in yet another if-cast-callTheSpecificHandleMethod.
Or am I missing something and how would the RequestProcessor look like then?</description>
		<content:encoded><![CDATA[<p>@Jeremy</p>
<p>The solution you provided, doesn&#8217;t seem like a very good solution to me.<br />
By doing this, the RequestProcessor (the one who resolves the RequestHandlers and calls their Handle method) would have to know which types have a Handle method with a UnitOfWork and which don&#8217;t, probably resulting in an if-cast and at least 2 different ways to call a RequestHandler. If for some reason another type of RequestHandler is introduced it would result in yet another if-cast-callTheSpecificHandleMethod.<br />
Or am I missing something and how would the RequestProcessor look like then?</p>
<img src="http://feeds.feedburner.com/~r/davybrioncomments/~4/L6UmbVYd1OE" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://davybrion.com/blog/2009/11/constructor-injection-vs-sette-injection/comment-page-1/#comment-22880</feedburner:origLink></item>
	<item>
		<title>Comment on New Hardware, New Software by Davy Brion</title>
		<link>http://feedproxy.google.com/~r/davybrioncomments/~3/wnkoK1x5kkU/</link>
		<dc:creator>Davy Brion</dc:creator>
		<pubDate>Wed, 04 Nov 2009 06:40:57 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=1833#comment-22878</guid>
		<description>@Tom

Who really sounds like a drone here? I just stated my personal preference, which i think i'm allowed to do ;)</description>
		<content:encoded><![CDATA[<p>@Tom</p>
<p>Who really sounds like a drone here? I just stated my personal preference, which i think i&#8217;m allowed to do <img src='http://davybrion.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<img src="http://feeds.feedburner.com/~r/davybrioncomments/~4/wnkoK1x5kkU" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://davybrion.com/blog/2009/11/new-hardware-new-software/comment-page-1/#comment-22878</feedburner:origLink></item>
	<item>
		<title>Comment on Constructor Injection vs Setter Injection by Davy Brion</title>
		<link>http://feedproxy.google.com/~r/davybrioncomments/~3/q4cCAmFGUU4/</link>
		<dc:creator>Davy Brion</dc:creator>
		<pubDate>Wed, 04 Nov 2009 06:37:47 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=1715#comment-22877</guid>
		<description>@Jeremy

i'm still not convinced of the approach you mentioned in your comment. The end result would be practically the same, and i wouldn't really get any benefit out of it (and it would hurt backwards compatibility which i have to take into account).  The reason why i don't really get any benefit out it is because nobody ever has a reference to a handler. A specific handler is instantiated by the IOC container whenever a request comes into the service layer, and the Handle(Request) method is called, after which the resulting Response is just returned.  You never instantiate or deal with a handler yourself, so the fact that the IUnitOfWork instance is exposed by a public getter/setter doesn't really hurt anyone.  Theoretically it certainly doesn't have to be there and it shouldn't be exposed.  But if nobody gets the chance to actually access it (apart from the IOC container that provides the dependency), is there really a problem?

As for the SRP thing... i guess it depends on how strict you are about it.  For me, a specific handler class will only have code to take care of the functionality it needs to provide.  Nothing more, nothing less.  It doesn't need to worry about the UnitOfWork or the database transaction and automatic commits/rollbacks.  Whether that is achieved through inheritance or composition doesn't really matter to me so long as there is no noticeable downside to it.

that said, i do enjoy these sort of discussions so please feel free to share your other variations :)</description>
		<content:encoded><![CDATA[<p>@Jeremy</p>
<p>i&#8217;m still not convinced of the approach you mentioned in your comment. The end result would be practically the same, and i wouldn&#8217;t really get any benefit out of it (and it would hurt backwards compatibility which i have to take into account).  The reason why i don&#8217;t really get any benefit out it is because nobody ever has a reference to a handler. A specific handler is instantiated by the IOC container whenever a request comes into the service layer, and the Handle(Request) method is called, after which the resulting Response is just returned.  You never instantiate or deal with a handler yourself, so the fact that the IUnitOfWork instance is exposed by a public getter/setter doesn&#8217;t really hurt anyone.  Theoretically it certainly doesn&#8217;t have to be there and it shouldn&#8217;t be exposed.  But if nobody gets the chance to actually access it (apart from the IOC container that provides the dependency), is there really a problem?</p>
<p>As for the SRP thing&#8230; i guess it depends on how strict you are about it.  For me, a specific handler class will only have code to take care of the functionality it needs to provide.  Nothing more, nothing less.  It doesn&#8217;t need to worry about the UnitOfWork or the database transaction and automatic commits/rollbacks.  Whether that is achieved through inheritance or composition doesn&#8217;t really matter to me so long as there is no noticeable downside to it.</p>
<p>that said, i do enjoy these sort of discussions so please feel free to share your other variations <img src='http://davybrion.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<img src="http://feeds.feedburner.com/~r/davybrioncomments/~4/q4cCAmFGUU4" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://davybrion.com/blog/2009/11/constructor-injection-vs-sette-injection/comment-page-1/#comment-22877</feedburner:origLink></item>
	<item>
		<title>Comment on New Hardware, New Software by Tom</title>
		<link>http://feedproxy.google.com/~r/davybrioncomments/~3/fDjYbJWTcUI/</link>
		<dc:creator>Tom</dc:creator>
		<pubDate>Wed, 04 Nov 2009 01:48:26 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=1833#comment-22876</guid>
		<description>Windows 7 is "butt ugly," LOL.  Obviously you are an Apple drone.  Happy to overpay for Apple hardware and brainwashed into thinking that OS X is anywhere in the same class as Windows 7.</description>
		<content:encoded><![CDATA[<p>Windows 7 is &#8220;butt ugly,&#8221; LOL.  Obviously you are an Apple drone.  Happy to overpay for Apple hardware and brainwashed into thinking that OS X is anywhere in the same class as Windows 7.</p>
<img src="http://feeds.feedburner.com/~r/davybrioncomments/~4/fDjYbJWTcUI" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://davybrion.com/blog/2009/11/new-hardware-new-software/comment-page-1/#comment-22876</feedburner:origLink></item>
	<item>
		<title>Comment on Constructor Injection vs Setter Injection by Jeremy Gray</title>
		<link>http://feedproxy.google.com/~r/davybrioncomments/~3/fnjT_yxNZCE/</link>
		<dc:creator>Jeremy Gray</dc:creator>
		<pubDate>Tue, 03 Nov 2009 16:10:43 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=1715#comment-22875</guid>
		<description>By the way, I have some other variations on the implementation eluded to above, so just let me know if you'd like to hear about them. They might align better with your implementation constraints, worldview, etc.</description>
		<content:encoded><![CDATA[<p>By the way, I have some other variations on the implementation eluded to above, so just let me know if you&#8217;d like to hear about them. They might align better with your implementation constraints, worldview, etc.</p>
<img src="http://feeds.feedburner.com/~r/davybrioncomments/~4/fnjT_yxNZCE" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://davybrion.com/blog/2009/11/constructor-injection-vs-sette-injection/comment-page-1/#comment-22875</feedburner:origLink></item>
	<item>
		<title>Comment on Constructor Injection vs Setter Injection by Jeremy Gray</title>
		<link>http://feedproxy.google.com/~r/davybrioncomments/~3/kibM1YLR5oc/</link>
		<dc:creator>Jeremy Gray</dc:creator>
		<pubDate>Tue, 03 Nov 2009 15:26:28 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=1715#comment-22874</guid>
		<description>I have only a few moments to reply before I must head off to the office, but off the top of my head the main option jumping out at me is move your Template Method implementation away from inheritance and towards composition (via nested closure or the like). You can do this in a few steps to make it easier.

The first step is to change the signature for your template method body from base.Handle(request) to base.Handle(UnitOfWork, request), allowing you to remove the derived type dependencies on the UnitOfWork property. Next, just to enforce that change, take the getter off the UnitOfWork property, or at least make it private to the base type. Then, replace inheritance with composition. Instead of deriving to implement Handle(UnitOfWork, TRequest) you instantiate just one implementation of a request handler and then call Handle. Handle would do your familiar transaction setup and then call a closure of the form TResponse Handle(IUnitOfWork, TRequest). The closure itself would assume operation within a transaction that commits on successful return and rolls back on any exception thrown from the closure. The closure would have been passed into the call to Handle itself, assuming the Handle signature can be modified, or passed into the ctor (if you are using a container that supports dependency override (StructureMap does, for example)) if the Handle signature cannot be modified. If it cannot, the ctor injection would do nicely. If your container can't do dependency overrides, either get one that can or use setter injection for the closure.

Now, all of that said, if you ended up back at setter injection of a closure instead of setter injection of the unit of work, one would have to consider if the improvement of killing the SRP violation was worth the trouble. With that in mind, much of the above hinges itself on whether or not you can change the signature of the Handle method to accept the closure or your container (and instantiation pattern) will allow you to use ctor dependency override.

As for "I really don’t see this is as a violation of the Single Responsibility Principle.", addressing unit of work and transactions is a separate concern from request-specific handling logic, and your current use of Template Method pattern simply proves the existence of the SRP violation, as much as it is occluded behind the responsibilities of the base type versus those of the derived types. That said, your current approach certainly isn't a huge SRP violation and there may well be more pressing matters to hunt down within your codebase since your application of Template Method does a good job of minimizing the visibility and impact.

You could for the moment just do part of the change, as a prep move and a valuable piece of clean-up in its own right: the first two steps, changing the base.Handle(request) signature to also accept the unit of work and then hiding the UnitOfWork property from the derived types (and from outside code, which has its own benefit.)</description>
		<content:encoded><![CDATA[<p>I have only a few moments to reply before I must head off to the office, but off the top of my head the main option jumping out at me is move your Template Method implementation away from inheritance and towards composition (via nested closure or the like). You can do this in a few steps to make it easier.</p>
<p>The first step is to change the signature for your template method body from base.Handle(request) to base.Handle(UnitOfWork, request), allowing you to remove the derived type dependencies on the UnitOfWork property. Next, just to enforce that change, take the getter off the UnitOfWork property, or at least make it private to the base type. Then, replace inheritance with composition. Instead of deriving to implement Handle(UnitOfWork, TRequest) you instantiate just one implementation of a request handler and then call Handle. Handle would do your familiar transaction setup and then call a closure of the form TResponse Handle(IUnitOfWork, TRequest). The closure itself would assume operation within a transaction that commits on successful return and rolls back on any exception thrown from the closure. The closure would have been passed into the call to Handle itself, assuming the Handle signature can be modified, or passed into the ctor (if you are using a container that supports dependency override (StructureMap does, for example)) if the Handle signature cannot be modified. If it cannot, the ctor injection would do nicely. If your container can&#8217;t do dependency overrides, either get one that can or use setter injection for the closure.</p>
<p>Now, all of that said, if you ended up back at setter injection of a closure instead of setter injection of the unit of work, one would have to consider if the improvement of killing the SRP violation was worth the trouble. With that in mind, much of the above hinges itself on whether or not you can change the signature of the Handle method to accept the closure or your container (and instantiation pattern) will allow you to use ctor dependency override.</p>
<p>As for &#8220;I really don’t see this is as a violation of the Single Responsibility Principle.&#8221;, addressing unit of work and transactions is a separate concern from request-specific handling logic, and your current use of Template Method pattern simply proves the existence of the SRP violation, as much as it is occluded behind the responsibilities of the base type versus those of the derived types. That said, your current approach certainly isn&#8217;t a huge SRP violation and there may well be more pressing matters to hunt down within your codebase since your application of Template Method does a good job of minimizing the visibility and impact.</p>
<p>You could for the moment just do part of the change, as a prep move and a valuable piece of clean-up in its own right: the first two steps, changing the base.Handle(request) signature to also accept the unit of work and then hiding the UnitOfWork property from the derived types (and from outside code, which has its own benefit.)</p>
<img src="http://feeds.feedburner.com/~r/davybrioncomments/~4/kibM1YLR5oc" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://davybrion.com/blog/2009/11/constructor-injection-vs-sette-injection/comment-page-1/#comment-22874</feedburner:origLink></item>
	<item>
		<title>Comment on Constructor Injection vs Setter Injection by Davy Brion</title>
		<link>http://feedproxy.google.com/~r/davybrioncomments/~3/_PuNaWsrmgM/</link>
		<dc:creator>Davy Brion</dc:creator>
		<pubDate>Tue, 03 Nov 2009 07:23:39 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=1715#comment-22873</guid>
		<description>@Jeremy 

that actually is a real-world example :)

how would you change the design so that the handler executes within the scope of the UnitOfWork _and_ has access to it? I could've gone the AOP route (either dynamically with Windsor or statically with Postsharp) but then i wouldn't have access to the UOW in the derived handlers. If you have anything else in mind, please do share :)

Also, classes that derive from this specific handler typically introduce another dependency for context-related data so it can easily be accessed in the handlers that derive from that.

I really don't see this is as a violation of the Single Responsibility Principle.</description>
		<content:encoded><![CDATA[<p>@Jeremy </p>
<p>that actually is a real-world example <img src='http://davybrion.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>how would you change the design so that the handler executes within the scope of the UnitOfWork _and_ has access to it? I could&#8217;ve gone the AOP route (either dynamically with Windsor or statically with Postsharp) but then i wouldn&#8217;t have access to the UOW in the derived handlers. If you have anything else in mind, please do share <img src='http://davybrion.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Also, classes that derive from this specific handler typically introduce another dependency for context-related data so it can easily be accessed in the handlers that derive from that.</p>
<p>I really don&#8217;t see this is as a violation of the Single Responsibility Principle.</p>
<img src="http://feeds.feedburner.com/~r/davybrioncomments/~4/_PuNaWsrmgM" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://davybrion.com/blog/2009/11/constructor-injection-vs-sette-injection/comment-page-1/#comment-22873</feedburner:origLink></item>
	<item>
		<title>Comment on Constructor Injection vs Setter Injection by Jeremy Gray</title>
		<link>http://feedproxy.google.com/~r/davybrioncomments/~3/S9OJLC79ydU/</link>
		<dc:creator>Jeremy Gray</dc:creator>
		<pubDate>Tue, 03 Nov 2009 06:02:15 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=1715#comment-22872</guid>
		<description>@Davy - Dmitriy is still right, though, even given your example. Heck, especially given your example. It would be trivial to refactor such a handler design so that individual handler implementations execute within a transaction and are provided a unit of work, yet perform none of the unit of work prep, transaction creation, commit, or even the rollback in case of a failure. Since the ability to perform such a refactoring might be dependent on the simplicity of your provided example, can you provide a more real-world example we can look at?</description>
		<content:encoded><![CDATA[<p>@Davy &#8211; Dmitriy is still right, though, even given your example. Heck, especially given your example. It would be trivial to refactor such a handler design so that individual handler implementations execute within a transaction and are provided a unit of work, yet perform none of the unit of work prep, transaction creation, commit, or even the rollback in case of a failure. Since the ability to perform such a refactoring might be dependent on the simplicity of your provided example, can you provide a more real-world example we can look at?</p>
<img src="http://feeds.feedburner.com/~r/davybrioncomments/~4/S9OJLC79ydU" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://davybrion.com/blog/2009/11/constructor-injection-vs-sette-injection/comment-page-1/#comment-22872</feedburner:origLink></item>
	<item>
		<title>Comment on Database Audit Trails: How Would You Do It? by Niraj</title>
		<link>http://feedproxy.google.com/~r/davybrioncomments/~3/iBYES31_-mY/</link>
		<dc:creator>Niraj</dc:creator>
		<pubDate>Tue, 03 Nov 2009 03:20:12 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=1764#comment-22871</guid>
		<description>Hi Davy,

   I posted my thoughts &lt;a href="http://nirajrules.wordpress.com/2009/11/02/implementing-audit-trail-for-your-application" rel="nofollow"&gt;here&lt;/a&gt;. Let me know your thoughts.

Niraj</description>
		<content:encoded><![CDATA[<p>Hi Davy,</p>
<p>   I posted my thoughts <a href="http://nirajrules.wordpress.com/2009/11/02/implementing-audit-trail-for-your-application" rel="nofollow">here</a>. Let me know your thoughts.</p>
<p>Niraj</p>
<img src="http://feeds.feedburner.com/~r/davybrioncomments/~4/iBYES31_-mY" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://davybrion.com/blog/2009/10/database-audit-trails-how-would-you-do-it/comment-page-1/#comment-22871</feedburner:origLink></item>
	<item>
		<title>Comment on Finding Memory Leaks In Silverlight With WinDbg by Jeremy Likness' Blog : A Weak Post</title>
		<link>http://feedproxy.google.com/~r/davybrioncomments/~3/fzx6da-raXw/</link>
		<dc:creator>Jeremy Likness' Blog : A Weak Post</dc:creator>
		<pubDate>Mon, 02 Nov 2009 21:53:41 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=1496#comment-22870</guid>
		<description>[...] Of course, I've left out the implemenation of fetching this, but you get the point. While that is an interesting example, how about a more practical one? One of the most common causes of memory leaks in Silverlight/WPF applications is related to the registering and unregistering of events. To learn more about this memory leak (and also learn how to troubleshoot/debug/and find the source of the leak), read this article about finding memory leaks in Silverlight. [...]</description>
		<content:encoded><![CDATA[<p>[...] Of course, I&#39;ve left out the implemenation of fetching this, but you get the point. While that is an interesting example, how about a more practical one? One of the most common causes of memory leaks in Silverlight/WPF applications is related to the registering and unregistering of events. To learn more about this memory leak (and also learn how to troubleshoot/debug/and find the source of the leak), read this article about finding memory leaks in Silverlight. [...]</p>
<img src="http://feeds.feedburner.com/~r/davybrioncomments/~4/fzx6da-raXw" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://davybrion.com/blog/2009/08/finding-memory-leaks-in-silverlight-with-windbg/comment-page-1/#comment-22870</feedburner:origLink></item>
	<item>
		<title>Comment on Constructor Injection vs Setter Injection by Davy Brion</title>
		<link>http://feedproxy.google.com/~r/davybrioncomments/~3/d5x_JM1wXEo/</link>
		<dc:creator>Davy Brion</dc:creator>
		<pubDate>Mon, 02 Nov 2009 12:10:15 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=1715#comment-22869</guid>
		<description>@Dmitriy

in most cases, i'd agree with that sentiment... but not in the context of the example given in the post :)</description>
		<content:encoded><![CDATA[<p>@Dmitriy</p>
<p>in most cases, i&#8217;d agree with that sentiment&#8230; but not in the context of the example given in the post <img src='http://davybrion.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<img src="http://feeds.feedburner.com/~r/davybrioncomments/~4/d5x_JM1wXEo" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://davybrion.com/blog/2009/11/constructor-injection-vs-sette-injection/comment-page-1/#comment-22869</feedburner:origLink></item>
	<item>
		<title>Comment on Constructor Injection vs Setter Injection by Dmitriy Naginryak</title>
		<link>http://feedproxy.google.com/~r/davybrioncomments/~3/q7X9_4VypMA/</link>
		<dc:creator>Dmitriy Naginryak</dc:creator>
		<pubDate>Mon, 02 Nov 2009 12:06:54 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=1715#comment-22868</guid>
		<description>I believe if you have too much 'noise' (too many dependencies) then you just violate SRP.
The class 99.9% should be split. Thus all dependencies will be split as well and make the code much cleaner.

Using propery injection to solve 'noisiness problem' is just akward workaround for the real issue - SRP violation.

Cheers.</description>
		<content:encoded><![CDATA[<p>I believe if you have too much &#8216;noise&#8217; (too many dependencies) then you just violate SRP.<br />
The class 99.9% should be split. Thus all dependencies will be split as well and make the code much cleaner.</p>
<p>Using propery injection to solve &#8216;noisiness problem&#8217; is just akward workaround for the real issue &#8211; SRP violation.</p>
<p>Cheers.</p>
<img src="http://feeds.feedburner.com/~r/davybrioncomments/~4/q7X9_4VypMA" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://davybrion.com/blog/2009/11/constructor-injection-vs-sette-injection/comment-page-1/#comment-22868</feedburner:origLink></item>
</channel>
</rss><!-- Dynamic page generated in 1.606 seconds. --><!-- Cached page generated by WP-Super-Cache on 2009-11-09 02:15:32 -->
