<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://devlicious.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Tim Barcz - All Comments</title><link>http://devlicious.com/blogs/tim_barcz/default.aspx</link><description>Why use nails when a screw is the more reversible choice?  Have Twitter, follow the conversation there at @&lt;a href="http://www.twitter.com/timbarcz"&gt;timbarcz&lt;/a&gt;</description><dc:language>en</dc:language><generator>CommunityServer 2007 (Build: 20416.853)</generator><item><title>re: Real Life Single Responsibility Principle</title><link>http://devlicious.com/blogs/tim_barcz/archive/2009/01/05/real-life-single-responsibility-principle.aspx#43662</link><pubDate>Wed, 07 Jan 2009 14:45:30 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:43662</guid><dc:creator>Tim Barcz</dc:creator><description>&lt;p&gt;@Dave&lt;/p&gt;
&lt;p&gt;Good point about DRY...you didn't get a chance to see the actual concrete implementations but they adhere to DRY. &amp;nbsp;See my comment reply above to &amp;quot;Scott&amp;quot; to understand. &amp;nbsp;Each piece of code that &amp;quot;sends&amp;quot; an email is unique for this application.&lt;/p&gt;
&lt;img src="http://devlicious.com/aggbug.aspx?PostID=43662" width="1" height="1"&gt;</description></item><item><title>re: Real Life Single Responsibility Principle</title><link>http://devlicious.com/blogs/tim_barcz/archive/2009/01/05/real-life-single-responsibility-principle.aspx#43661</link><pubDate>Wed, 07 Jan 2009 14:44:27 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:43661</guid><dc:creator>Tim Barcz</dc:creator><description>&lt;p&gt;@Scott&lt;/p&gt;
&lt;p&gt;The strategies are rather simplistic at this point. &amp;nbsp;The Queued service uses a database table and there is a job running on an interval which looks at this table to see what needs to get send.&lt;/p&gt;
&lt;p&gt;The real time email sends directly through SMTP.&lt;/p&gt;
&lt;p&gt;We have other solutions using MSMQ that we'd like to go to but it's just not justifiable right now in terms of setup and cost when what we have works and works well.&lt;/p&gt;
&lt;img src="http://devlicious.com/aggbug.aspx?PostID=43661" width="1" height="1"&gt;</description></item><item><title>re: Real Life Single Responsibility Principle</title><link>http://devlicious.com/blogs/tim_barcz/archive/2009/01/05/real-life-single-responsibility-principle.aspx#43660</link><pubDate>Wed, 07 Jan 2009 14:18:25 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:43660</guid><dc:creator>dave thieben</dc:creator><description>&lt;p&gt;Nice post. &amp;nbsp;However, I would remind people to also adhere to the DRY principle, in the chance that you have email-sending-related code that is the same in all three classes.&lt;/p&gt;
&lt;img src="http://devlicious.com/aggbug.aspx?PostID=43660" width="1" height="1"&gt;</description></item><item><title>re: Real Life Single Responsibility Principle</title><link>http://devlicious.com/blogs/tim_barcz/archive/2009/01/05/real-life-single-responsibility-principle.aspx#43659</link><pubDate>Wed, 07 Jan 2009 13:29:11 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:43659</guid><dc:creator>Scott</dc:creator><description>&lt;p&gt;What happens when you have a second high priority message to send before the previous high priority message send is complete? &amp;nbsp;Don't the high priority messages need to queue up also?&lt;/p&gt;
&lt;p&gt;Not to disagree with how you implemented the solution you decided upon but rather to suggest another solution; Did you consider have multiple queues and a class to pull from the queues based on priority? &amp;nbsp;Ie. a low priority and high priority queue. Many MTA's use this approach as it is conceivable that many high priority emails will need to be sent at any given time. At that point, you need to work through all the high priority items before returning to normal or low priority items in the simplest approach. Others might do a biased round robin H-H-N-H-H-N-H-H-L-H-H-N ..... kind of thing. &lt;/p&gt;
&lt;img src="http://devlicious.com/aggbug.aspx?PostID=43659" width="1" height="1"&gt;</description></item><item><title>re: Real Life Single Responsibility Principle</title><link>http://devlicious.com/blogs/tim_barcz/archive/2009/01/05/real-life-single-responsibility-principle.aspx#43629</link><pubDate>Tue, 06 Jan 2009 14:49:37 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:43629</guid><dc:creator>Tim Barcz</dc:creator><description>&lt;p&gt;@Lance&lt;/p&gt;
&lt;p&gt;Tuna is correct, everything get's stitched together through our use of Windsor (IoC container). &amp;nbsp;I recognize that this may create some confusion when people say &amp;quot;just use an IoC container&amp;quot; and so I hope to get some concrete examples out there sometime&lt;/p&gt;
&lt;img src="http://devlicious.com/aggbug.aspx?PostID=43629" width="1" height="1"&gt;</description></item><item><title>Dew Drop - January 6, 2009 | Alvin Ashcraft's Morning Dew</title><link>http://devlicious.com/blogs/tim_barcz/archive/2009/01/05/real-life-single-responsibility-principle.aspx#43628</link><pubDate>Tue, 06 Jan 2009 14:27:55 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:43628</guid><dc:creator>Dew Drop - January 6, 2009 | Alvin Ashcraft's Morning Dew</dc:creator><description>&lt;p&gt;Pingback from &amp;nbsp;Dew Drop - January 6, 2009 | Alvin Ashcraft's Morning Dew&lt;/p&gt;
&lt;img src="http://devlicious.com/aggbug.aspx?PostID=43628" width="1" height="1"&gt;</description></item><item><title>Reflective Perspective - Chris Alcock  &amp;raquo; The Morning Brew #258</title><link>http://devlicious.com/blogs/tim_barcz/archive/2009/01/05/real-life-single-responsibility-principle.aspx#43622</link><pubDate>Tue, 06 Jan 2009 08:52:58 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:43622</guid><dc:creator>Reflective Perspective - Chris Alcock  » The Morning Brew #258</dc:creator><description>&lt;p&gt;Pingback from &amp;nbsp;Reflective Perspective - Chris Alcock &amp;nbsp;&amp;amp;raquo; The Morning Brew #258&lt;/p&gt;
&lt;img src="http://devlicious.com/aggbug.aspx?PostID=43622" width="1" height="1"&gt;</description></item><item><title>re: Real Life Single Responsibility Principle</title><link>http://devlicious.com/blogs/tim_barcz/archive/2009/01/05/real-life-single-responsibility-principle.aspx#43621</link><pubDate>Mon, 05 Jan 2009 23:23:39 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:43621</guid><dc:creator>Tuna Toksoz</dc:creator><description>&lt;p&gt;@Lance probably IoC would do that, you can configure a specific class to be resolved. &lt;/p&gt;
&lt;img src="http://devlicious.com/aggbug.aspx?PostID=43621" width="1" height="1"&gt;</description></item><item><title>re: Real Life Single Responsibility Principle</title><link>http://devlicious.com/blogs/tim_barcz/archive/2009/01/05/real-life-single-responsibility-principle.aspx#43620</link><pubDate>Mon, 05 Jan 2009 22:50:58 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:43620</guid><dc:creator>Lance</dc:creator><description>&lt;p&gt;I'm talking about how consumers would use this class. &amp;nbsp;How would they know to use one mail service or the other? &amp;nbsp;If the only difference is the mail priority, I'm not sure why the Queued or Real time services would even need to be exposed to the client since sending it to the PriorityMailBasedService would take care of sending the email without the client needing to worry about the priority which seems to be more agree more with the Law of Demeter. &amp;nbsp;Forgive me if I am being dense.&lt;/p&gt;
&lt;img src="http://devlicious.com/aggbug.aspx?PostID=43620" width="1" height="1"&gt;</description></item><item><title>re: Real Life Single Responsibility Principle</title><link>http://devlicious.com/blogs/tim_barcz/archive/2009/01/05/real-life-single-responsibility-principle.aspx#43619</link><pubDate>Mon, 05 Jan 2009 22:35:27 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:43619</guid><dc:creator>Tim Barcz</dc:creator><description>&lt;p&gt;@Lance&lt;/p&gt;
&lt;p&gt;The if statement is how I know which one to use.&lt;/p&gt;
&lt;p&gt;Three classes, three different responsibilities:&lt;/p&gt;
&lt;p&gt;1. QueuedEmailService - queue the message for some other processing&lt;/p&gt;
&lt;p&gt;2. RealTimeEmailService - send the mail right now&lt;/p&gt;
&lt;p&gt;3. PriorityBasedEmailService - figure out which service to use.&lt;/p&gt;
&lt;p&gt;Does that clear it up at all? &amp;nbsp;Let me know and I'll seek to clarify further.&lt;/p&gt;
&lt;img src="http://devlicious.com/aggbug.aspx?PostID=43619" width="1" height="1"&gt;</description></item><item><title>re: Real Life Single Responsibility Principle</title><link>http://devlicious.com/blogs/tim_barcz/archive/2009/01/05/real-life-single-responsibility-principle.aspx#43618</link><pubDate>Mon, 05 Jan 2009 22:32:57 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:43618</guid><dc:creator>SuperJason</dc:creator><description>&lt;p&gt;Ok, I was just trying to clarify what you were saying.&lt;/p&gt;
&lt;p&gt;Personally, I avoid SendAsync as well.&lt;/p&gt;
&lt;img src="http://devlicious.com/aggbug.aspx?PostID=43618" width="1" height="1"&gt;</description></item><item><title>re: Real Life Single Responsibility Principle</title><link>http://devlicious.com/blogs/tim_barcz/archive/2009/01/05/real-life-single-responsibility-principle.aspx#43617</link><pubDate>Mon, 05 Jan 2009 22:31:59 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:43617</guid><dc:creator>Lance</dc:creator><description>&lt;p&gt;You don't show how these classes are being used. &amp;nbsp;When do you know whether to use Queued or Realtime if you don't use an if statement? &amp;nbsp;There's an if statement in the PriorityBasedEmailService which seems like more conditions could be added on later.&lt;/p&gt;
&lt;img src="http://devlicious.com/aggbug.aspx?PostID=43617" width="1" height="1"&gt;</description></item><item><title>re: Real Life Single Responsibility Principle</title><link>http://devlicious.com/blogs/tim_barcz/archive/2009/01/05/real-life-single-responsibility-principle.aspx#43616</link><pubDate>Mon, 05 Jan 2009 22:07:23 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:43616</guid><dc:creator>Lee Carter</dc:creator><description>&lt;p&gt;First, thanks for re-reminding me of the RDD concepts: Know, Do, Decide - it's a great, and useful, distinction.&lt;/p&gt;
&lt;p&gt;Second, I found the &amp;quot;now you might be thinking...&amp;quot; comments kind of annoying, until I realized that, yes, that's exactly what I was thinking. It was useful to get called on it. So...thanks for that, too.&lt;/p&gt;
&lt;img src="http://devlicious.com/aggbug.aspx?PostID=43616" width="1" height="1"&gt;</description></item><item><title>re: Real Life Single Responsibility Principle</title><link>http://devlicious.com/blogs/tim_barcz/archive/2009/01/05/real-life-single-responsibility-principle.aspx#43615</link><pubDate>Mon, 05 Jan 2009 21:48:04 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:43615</guid><dc:creator>Tim Barcz</dc:creator><description>&lt;p&gt;@SuperJason,&lt;/p&gt;
&lt;p&gt;Catching issues around mail and failing is harder with SendAsyn from my experience. &amp;nbsp;When it's a blocking call and it fails, you know.&lt;/p&gt;
&lt;img src="http://devlicious.com/aggbug.aspx?PostID=43615" width="1" height="1"&gt;</description></item><item><title>re: Real Life Single Responsibility Principle</title><link>http://devlicious.com/blogs/tim_barcz/archive/2009/01/05/real-life-single-responsibility-principle.aspx#43614</link><pubDate>Mon, 05 Jan 2009 21:43:36 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:43614</guid><dc:creator>SuperJason</dc:creator><description>&lt;p&gt;&amp;quot;(Note to BCL junkies: yes I know there is a SendAsync method). &amp;nbsp;There are a few instances in our application where we want email to be sent right away and not queued.&amp;quot;&lt;/p&gt;
&lt;p&gt;Are you suggesting that SendAsync doesn't send the email immediately? Not a big deal, but it works the same as &amp;quot;Send&amp;quot;, but the call itself is asynchronous.&lt;/p&gt;
&lt;img src="http://devlicious.com/aggbug.aspx?PostID=43614" width="1" height="1"&gt;</description></item></channel></rss>