<?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: Business Exceptions in c# (as I understand them!)</title>
	<atom:link href="http://idisposable.co.uk/2010/05/business-exceptions-in-c-as-i-understand-them/feed/" rel="self" type="application/rss+xml" />
	<link>http://idisposable.co.uk/2010/05/business-exceptions-in-c-as-i-understand-them/</link>
	<description>Throwaway thoughts from a .net developer</description>
	<lastBuildDate>Sun, 21 Aug 2011 10:25:03 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: 2010 &#8211; A year in geek</title>
		<link>http://idisposable.co.uk/2010/05/business-exceptions-in-c-as-i-understand-them/comment-page-1/#comment-302</link>
		<dc:creator>2010 &#8211; A year in geek</dc:creator>
		<pubDate>Thu, 30 Dec 2010 15:40:29 +0000</pubDate>
		<guid isPermaLink="false">http://idisposable.co.uk/?p=106#comment-302</guid>
		<description>[...] exceptions, the first was delivered at DevWeek which I was lucky enough to attend in April (see the post here), the second was delivered by Phil Winstanley (@plip) at DDD Scotland this [...]</description>
		<content:encoded><![CDATA[<p>[...] exceptions, the first was delivered at DevWeek which I was lucky enough to attend in April (see the post here), the second was delivered by Phil Winstanley (@plip) at DDD Scotland this [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: The Performance of Exceptional Things &#171; idisposable.co.uk</title>
		<link>http://idisposable.co.uk/2010/05/business-exceptions-in-c-as-i-understand-them/comment-page-1/#comment-264</link>
		<dc:creator>The Performance of Exceptional Things &#171; idisposable.co.uk</dc:creator>
		<pubDate>Fri, 14 May 2010 08:01:05 +0000</pubDate>
		<guid isPermaLink="false">http://idisposable.co.uk/?p=106#comment-264</guid>
		<description>[...] About              &#171; Business Exceptions in c# (as I understand them!) [...]</description>
		<content:encoded><![CDATA[<p>[...] About              &laquo; Business Exceptions in c# (as I understand them!) [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Most Tweeted Articles by Aspnet Experts: MrTweet</title>
		<link>http://idisposable.co.uk/2010/05/business-exceptions-in-c-as-i-understand-them/comment-page-1/#comment-263</link>
		<dc:creator>Most Tweeted Articles by Aspnet Experts: MrTweet</dc:creator>
		<pubDate>Thu, 13 May 2010 14:41:40 +0000</pubDate>
		<guid isPermaLink="false">http://idisposable.co.uk/?p=106#comment-263</guid>
		<description>&lt;strong&gt;Your article was most tweeted by Aspnet experts in the Twitterverse...&lt;/strong&gt;

Come see other top popular articles surfaced by Aspnet experts!...</description>
		<content:encoded><![CDATA[<p><strong>Your article was most tweeted by Aspnet experts in the Twitterverse&#8230;</strong></p>
<p>Come see other top popular articles surfaced by Aspnet experts!&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: admin</title>
		<link>http://idisposable.co.uk/2010/05/business-exceptions-in-c-as-i-understand-them/comment-page-1/#comment-262</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Thu, 13 May 2010 06:56:47 +0000</pubDate>
		<guid isPermaLink="false">http://idisposable.co.uk/?p=106#comment-262</guid>
		<description>As Option 3 goes, it&#039;s a good un :)

Certainly makes our class structure more complex if we have a lot of this sort of thing, but as you say, it&#039;s not exception based which removes the concerns re: performance.

I wish others had seen the talk at DevWeek - I&#039;ve bounced ideas with one of the guys here who also saw it, and he&#039;s convinced also that we&#039;re delivering in the way Jeffrey Richter defined, but it&#039;s really difficult to find any evidence - his slide decks seem to have vanished!

I shall go on a hunt and see if I can dig out any more, though I do like your approach Martin, thanks for commenting :)</description>
		<content:encoded><![CDATA[<p>As Option 3 goes, it&#8217;s a good un <img src='http://idisposable.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Certainly makes our class structure more complex if we have a lot of this sort of thing, but as you say, it&#8217;s not exception based which removes the concerns re: performance.</p>
<p>I wish others had seen the talk at DevWeek &#8211; I&#8217;ve bounced ideas with one of the guys here who also saw it, and he&#8217;s convinced also that we&#8217;re delivering in the way Jeffrey Richter defined, but it&#8217;s really difficult to find any evidence &#8211; his slide decks seem to have vanished!</p>
<p>I shall go on a hunt and see if I can dig out any more, though I do like your approach Martin, thanks for commenting <img src='http://idisposable.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Martin Evans</title>
		<link>http://idisposable.co.uk/2010/05/business-exceptions-in-c-as-i-understand-them/comment-page-1/#comment-261</link>
		<dc:creator>Martin Evans</dc:creator>
		<pubDate>Wed, 12 May 2010 19:26:24 +0000</pubDate>
		<guid isPermaLink="false">http://idisposable.co.uk/?p=106#comment-261</guid>
		<description>I would suggest that you&#039;re using exceptions a little too liberally in this case and would probably benefit from encapsulating all the info the controller needs, in an object that the ProcessLogin function can return.

How about creating a class called LoginResult, exposing the following public properties:

1. AuthenticatedUser of type User
2. Result of type loginResultEnum
3. Message of type string.

Set ProcessLogin to return an instance of LoginResult.

A successfull login will result in a LoginResult instance containing the user in the  AuthenticatedUser prop and a Result value.
An unsuccessful login will result in a LoginResult instances withAuthenticatedUser set to null, but the Result value property will reflect the reason why the login failed and the Message property will contain any message to used by the view.

That way then, the controller checks the LoginResult.Result property then decides what to do from there.

Not an exception in site... but the controller still gets all the info it needs to pass to the view. 

Exceptions aren&#039;t necessarily evil but I&#039;d argue that they&#039;d only be raised to handle things like the DAL borking out in it&#039;s call or other things that you haven&#039;t any particular control over. Just an idea!

One other thing. Would it be possible to pass the username and password into a DAL method (say Dal.GetUser(string username, string password))? That way then, if a user is returned, you&#039;ll know the username and pwd are valid.</description>
		<content:encoded><![CDATA[<p>I would suggest that you&#8217;re using exceptions a little too liberally in this case and would probably benefit from encapsulating all the info the controller needs, in an object that the ProcessLogin function can return.</p>
<p>How about creating a class called LoginResult, exposing the following public properties:</p>
<p>1. AuthenticatedUser of type User<br />
2. Result of type loginResultEnum<br />
3. Message of type string.</p>
<p>Set ProcessLogin to return an instance of LoginResult.</p>
<p>A successfull login will result in a LoginResult instance containing the user in the  AuthenticatedUser prop and a Result value.<br />
An unsuccessful login will result in a LoginResult instances withAuthenticatedUser set to null, but the Result value property will reflect the reason why the login failed and the Message property will contain any message to used by the view.</p>
<p>That way then, the controller checks the LoginResult.Result property then decides what to do from there.</p>
<p>Not an exception in site&#8230; but the controller still gets all the info it needs to pass to the view. </p>
<p>Exceptions aren&#8217;t necessarily evil but I&#8217;d argue that they&#8217;d only be raised to handle things like the DAL borking out in it&#8217;s call or other things that you haven&#8217;t any particular control over. Just an idea!</p>
<p>One other thing. Would it be possible to pass the username and password into a DAL method (say Dal.GetUser(string username, string password))? That way then, if a user is returned, you&#8217;ll know the username and pwd are valid.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tweets that mention Business Exceptions in c# (as I understand them!) « idisposable.co.uk -- Topsy.com</title>
		<link>http://idisposable.co.uk/2010/05/business-exceptions-in-c-as-i-understand-them/comment-page-1/#comment-260</link>
		<dc:creator>Tweets that mention Business Exceptions in c# (as I understand them!) « idisposable.co.uk -- Topsy.com</dc:creator>
		<pubDate>Wed, 12 May 2010 08:01:50 +0000</pubDate>
		<guid isPermaLink="false">http://idisposable.co.uk/?p=106#comment-260</guid>
		<description>[...] This post was mentioned on Twitter by Terry Brown, Terry Brown. Terry Brown said: Business Exceptions in c# (as I understand them!) http://goo.gl/fb/lzj6T [...]</description>
		<content:encoded><![CDATA[<p>[...] This post was mentioned on Twitter by Terry Brown, Terry Brown. Terry Brown said: Business Exceptions in c# (as I understand them!) <a href="http://goo.gl/fb/lzj6T" rel="nofollow">http://goo.gl/fb/lzj6T</a> [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>

