<?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: Autumn of Agile: Iteration 1 Part B is Available</title>
	<atom:link href="http://unhandled-exceptions.com/blog/index.php/2008/11/24/autumn-of-agile-iteration-1-part-b-is-available/feed/" rel="self" type="application/rss+xml" />
	<link>http://unhandled-exceptions.com/blog/index.php/2008/11/24/autumn-of-agile-iteration-1-part-b-is-available/</link>
	<description>Miscellaneous musings on life, .NET development, and related things that don't really matter</description>
	<pubDate>Thu, 17 May 2012 21:32:10 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: sbohlen</title>
		<link>http://unhandled-exceptions.com/blog/index.php/2008/11/24/autumn-of-agile-iteration-1-part-b-is-available/comment-page-1/#comment-18373</link>
		<dc:creator>sbohlen</dc:creator>
		<pubDate>Fri, 10 Jul 2009 19:21:37 +0000</pubDate>
		<guid isPermaLink="false">http://unhandled-exceptions.com/blog/index.php/2008/11/24/autumn-of-agile-iteration-1-part-b-is-available/#comment-18373</guid>
		<description>@Sam:

Thanks for the question(s).

We're creating a repository for each domain entity because long-term we know we will need to have repository methods that are more robust than the CRUD we are starting with.  The (example) signature of...

public class CustomerRepository : ICustomerRepository, NHRepository&lt; Customer &gt;

...is like that because I want to have a repository that will eventually evolve to handle just customers *in a domain-centric manner*.

Consumers of this will take a dependency only on the ICustomerRepository abstraction which will expose customer-centric methods only (e.g., .SaveCustomer(Customer) rather than .Save(T).  The implementation will use the generically-defined methods of the base class to get its work done under the covers, enabling me to leverage the power of the base class without exposing the 100s of methods it offers as being part of the actual repoitory's implementation (ICustomerRepository won't expose the CRUD-centric methods of the NHRepository&lt; T &gt; base class so consumers won't be aware/bothered by them).

Essentially, its this: if you just do...

public class Repostitory&lt; T &gt; : NHRepository&lt; T &gt;

...then you end up with a HUGE surface area for your repositories that offer up all kinds of CRUD-centric methods that aren't expressed in domain terms, slowly leading to what I call 'API pollution' where your repository is just too API-rich for anyone to know how to consume/interact with without some kind of giant API reference guide being provided to them.

One of the big things that can (often) be hard to get your head around in Domain Driven Design is that even though the 'role' of the repository is to provide 'persistence services' for your domain, its also got the role of *abstracting* persistence from the rest of your domain and that (usually) means not just wrapping CRUD methods in a repository object but also expressing the persitence of domain objects in domain terms.

As a concrete example of this, consider the following two methods, each of which MIGHT result in the same action, deleting a customer from the system:

CustomerRepository.Delete(Customer);
CustomerRepository.RetireCustomer(Customer);

Both might (in the end) result in the customer being deleted, but the first one is expressed in terms the DBA will understand and the second one is expressed in terms your domain experts will (hopefully) understand.

In fact, CustomerRepository.RetireCustomer(Customer) might even just flag the customer as 'inactive' in the system and *update* the record instead of even performing an actual delete, but the point is that you wouldn't actually have to CARE about that if you called CustomerRepository.RetireCustomer(Customer).

I hope this helps clarify where I'm coming from on this; I can agree with you that there may well be a YAGNI issue creeping in here, but my own personal experience has taught me that eventually IAGNA (I Am Gonna Need It) and so I'm proactively adding it before its immediately obvious that I will be requiring it.

Thanks again for the comments~!

-Steve B.</description>
		<content:encoded><![CDATA[<p>@Sam:</p>
<p>Thanks for the question(s).</p>
<p>We&#8217;re creating a repository for each domain entity because long-term we know we will need to have repository methods that are more robust than the CRUD we are starting with.  The (example) signature of&#8230;</p>
<p>public class CustomerRepository : ICustomerRepository, NHRepository< Customer ></p>
<p>&#8230;is like that because I want to have a repository that will eventually evolve to handle just customers *in a domain-centric manner*.</p>
<p>Consumers of this will take a dependency only on the ICustomerRepository abstraction which will expose customer-centric methods only (e.g., .SaveCustomer(Customer) rather than .Save(T).  The implementation will use the generically-defined methods of the base class to get its work done under the covers, enabling me to leverage the power of the base class without exposing the 100s of methods it offers as being part of the actual repoitory&#8217;s implementation (ICustomerRepository won&#8217;t expose the CRUD-centric methods of the NHRepository< T > base class so consumers won&#8217;t be aware/bothered by them).</p>
<p>Essentially, its this: if you just do&#8230;</p>
<p>public class Repostitory< T > : NHRepository< T ></p>
<p>&#8230;then you end up with a HUGE surface area for your repositories that offer up all kinds of CRUD-centric methods that aren&#8217;t expressed in domain terms, slowly leading to what I call &#8216;API pollution&#8217; where your repository is just too API-rich for anyone to know how to consume/interact with without some kind of giant API reference guide being provided to them.</p>
<p>One of the big things that can (often) be hard to get your head around in Domain Driven Design is that even though the &#8216;role&#8217; of the repository is to provide &#8216;persistence services&#8217; for your domain, its also got the role of *abstracting* persistence from the rest of your domain and that (usually) means not just wrapping CRUD methods in a repository object but also expressing the persitence of domain objects in domain terms.</p>
<p>As a concrete example of this, consider the following two methods, each of which MIGHT result in the same action, deleting a customer from the system:</p>
<p>CustomerRepository.Delete(Customer);<br />
CustomerRepository.RetireCustomer(Customer);</p>
<p>Both might (in the end) result in the customer being deleted, but the first one is expressed in terms the DBA will understand and the second one is expressed in terms your domain experts will (hopefully) understand.</p>
<p>In fact, CustomerRepository.RetireCustomer(Customer) might even just flag the customer as &#8216;inactive&#8217; in the system and *update* the record instead of even performing an actual delete, but the point is that you wouldn&#8217;t actually have to CARE about that if you called CustomerRepository.RetireCustomer(Customer).</p>
<p>I hope this helps clarify where I&#8217;m coming from on this; I can agree with you that there may well be a YAGNI issue creeping in here, but my own personal experience has taught me that eventually IAGNA (I Am Gonna Need It) and so I&#8217;m proactively adding it before its immediately obvious that I will be requiring it.</p>
<p>Thanks again for the comments~!</p>
<p>-Steve B.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sam</title>
		<link>http://unhandled-exceptions.com/blog/index.php/2008/11/24/autumn-of-agile-iteration-1-part-b-is-available/comment-page-1/#comment-18290</link>
		<dc:creator>Sam</dc:creator>
		<pubDate>Thu, 09 Jul 2009 14:38:07 +0000</pubDate>
		<guid isPermaLink="false">http://unhandled-exceptions.com/blog/index.php/2008/11/24/autumn-of-agile-iteration-1-part-b-is-available/#comment-18290</guid>
		<description>With regards to my previous post, seems the "T" has been escaped when posting the code on this site, but the generic type will be passed into the GenericRepository""

 "public class GenericRepository : Rhino.Commons.NHRepository
    {
    }"</description>
		<content:encoded><![CDATA[<p>With regards to my previous post, seems the &#8220;T&#8221; has been escaped when posting the code on this site, but the generic type will be passed into the GenericRepository&#8221;"</p>
<p> &#8220;public class GenericRepository : Rhino.Commons.NHRepository<br />
    {<br />
    }&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sam</title>
		<link>http://unhandled-exceptions.com/blog/index.php/2008/11/24/autumn-of-agile-iteration-1-part-b-is-available/comment-page-1/#comment-18280</link>
		<dc:creator>Sam</dc:creator>
		<pubDate>Thu, 09 Jul 2009 10:49:21 +0000</pubDate>
		<guid isPermaLink="false">http://unhandled-exceptions.com/blog/index.php/2008/11/24/autumn-of-agile-iteration-1-part-b-is-available/#comment-18280</guid>
		<description>Right. I have found great value in the series, but I have some queries after running through the code.

Each of the repositories are doing pretty much the same functions i.e. save, get, find etc. 

Yet we are creating a repository every time and using the base class to execute the function. This requires manually adding the repository and interfaces for entities which may not ever require any additional methods to persist data. This smells of a DRY (Don't Repeat Yourself) violation.

Surely we could register a generic repository with windsor and use generics to pass in the entity. Something like:

 public class GenericRepository : Rhino.Commons.NHRepository
    {
    }

container.Register(Component.For(typeof(IRepository)).ImplementedBy(typeof(GenericRepository)));

and then have access to it via:
IRepository repository = IoC.Container.Resolve&#60;IRepository&#62;();

My issue seems to be how to handle the UnitOfWork?? 

I would rather not have to create a repository for every entity and would rather create a specific repository for an entity that requires extended methods.

So, is there a workaround to handle the UnitOfWork? I am sure this is a common concern.

Sam</description>
		<content:encoded><![CDATA[<p>Right. I have found great value in the series, but I have some queries after running through the code.</p>
<p>Each of the repositories are doing pretty much the same functions i.e. save, get, find etc. </p>
<p>Yet we are creating a repository every time and using the base class to execute the function. This requires manually adding the repository and interfaces for entities which may not ever require any additional methods to persist data. This smells of a DRY (Don&#8217;t Repeat Yourself) violation.</p>
<p>Surely we could register a generic repository with windsor and use generics to pass in the entity. Something like:</p>
<p> public class GenericRepository : Rhino.Commons.NHRepository<br />
    {<br />
    }</p>
<p>container.Register(Component.For(typeof(IRepository)).ImplementedBy(typeof(GenericRepository)));</p>
<p>and then have access to it via:<br />
IRepository repository = IoC.Container.Resolve&lt;IRepository&gt;();</p>
<p>My issue seems to be how to handle the UnitOfWork?? </p>
<p>I would rather not have to create a repository for every entity and would rather create a specific repository for an entity that requires extended methods.</p>
<p>So, is there a workaround to handle the UnitOfWork? I am sure this is a common concern.</p>
<p>Sam</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sbohlen</title>
		<link>http://unhandled-exceptions.com/blog/index.php/2008/11/24/autumn-of-agile-iteration-1-part-b-is-available/comment-page-1/#comment-14950</link>
		<dc:creator>sbohlen</dc:creator>
		<pubDate>Mon, 11 May 2009 15:37:26 +0000</pubDate>
		<guid isPermaLink="false">http://unhandled-exceptions.com/blog/index.php/2008/11/24/autumn-of-agile-iteration-1-part-b-is-available/#comment-14950</guid>
		<description>@Chev:

Thanks for the feedback; glad you are enjoying the content and finding value in it.

Re: the Microdesk.Domain.Foundation classes, see this post for an update (I've gone OSS with the code now)...

http://unhandled-exceptions.com/blog/index.php/2009/03/16/proteus-unit-test-utility-and-domain-foundation-code-goes-oss/

HTH,

-Steve B.</description>
		<content:encoded><![CDATA[<p>@Chev:</p>
<p>Thanks for the feedback; glad you are enjoying the content and finding value in it.</p>
<p>Re: the Microdesk.Domain.Foundation classes, see this post for an update (I&#8217;ve gone OSS with the code now)&#8230;</p>
<p><a href="http://unhandled-exceptions.com/blog/index.php/2009/03/16/proteus-unit-test-utility-and-domain-foundation-code-goes-oss/" rel="nofollow">http://unhandled-exceptions.com/blog/index.php/2009/03/16/proteus-unit-test-utility-and-domain-foundation-code-goes-oss/</a></p>
<p>HTH,</p>
<p>-Steve B.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chev</title>
		<link>http://unhandled-exceptions.com/blog/index.php/2008/11/24/autumn-of-agile-iteration-1-part-b-is-available/comment-page-1/#comment-14891</link>
		<dc:creator>Chev</dc:creator>
		<pubDate>Sun, 10 May 2009 17:30:09 +0000</pubDate>
		<guid isPermaLink="false">http://unhandled-exceptions.com/blog/index.php/2008/11/24/autumn-of-agile-iteration-1-part-b-is-available/#comment-14891</guid>
		<description>Hey Steve-o

love the casts and very thankful for effort. How we doing with the microdesk.domain.foundation classes? perhaps even a stripped down version just to highlight the db load &#38; save functionality?

love your work

Chev</description>
		<content:encoded><![CDATA[<p>Hey Steve-o</p>
<p>love the casts and very thankful for effort. How we doing with the microdesk.domain.foundation classes? perhaps even a stripped down version just to highlight the db load &amp; save functionality?</p>
<p>love your work</p>
<p>Chev</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sbohlen</title>
		<link>http://unhandled-exceptions.com/blog/index.php/2008/11/24/autumn-of-agile-iteration-1-part-b-is-available/comment-page-1/#comment-10915</link>
		<dc:creator>sbohlen</dc:creator>
		<pubDate>Tue, 17 Feb 2009 01:26:44 +0000</pubDate>
		<guid isPermaLink="false">http://unhandled-exceptions.com/blog/index.php/2008/11/24/autumn-of-agile-iteration-1-part-b-is-available/#comment-10915</guid>
		<description>@mynkow:

Technically, the unit test utility supports only DBs that the underlying NDbUnit core library provides support for so you could actually develop a patch RIGHT NOW for NDbUnit and I could apply that to the trunk and then extend the unit test utility to leverage this new DB type quite easily.

The Unit Test Utility's list of supported DBs is just an abstraction-wrapper around the NDbUnit support for diff DBs.</description>
		<content:encoded><![CDATA[<p>@mynkow:</p>
<p>Technically, the unit test utility supports only DBs that the underlying NDbUnit core library provides support for so you could actually develop a patch RIGHT NOW for NDbUnit and I could apply that to the trunk and then extend the unit test utility to leverage this new DB type quite easily.</p>
<p>The Unit Test Utility&#8217;s list of supported DBs is just an abstraction-wrapper around the NDbUnit support for diff DBs.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mynkow</title>
		<link>http://unhandled-exceptions.com/blog/index.php/2008/11/24/autumn-of-agile-iteration-1-part-b-is-available/comment-page-1/#comment-10886</link>
		<dc:creator>mynkow</dc:creator>
		<pubDate>Mon, 16 Feb 2009 19:23:26 +0000</pubDate>
		<guid isPermaLink="false">http://unhandled-exceptions.com/blog/index.php/2008/11/24/autumn-of-agile-iteration-1-part-b-is-available/#comment-10886</guid>
		<description>Good to hear that. When this becomes reality I want to add a support for compact database in UnitTestUtility library.</description>
		<content:encoded><![CDATA[<p>Good to hear that. When this becomes reality I want to add a support for compact database in UnitTestUtility library.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sbohlen</title>
		<link>http://unhandled-exceptions.com/blog/index.php/2008/11/24/autumn-of-agile-iteration-1-part-b-is-available/comment-page-1/#comment-10687</link>
		<dc:creator>sbohlen</dc:creator>
		<pubDate>Thu, 12 Feb 2009 01:39:31 +0000</pubDate>
		<guid isPermaLink="false">http://unhandled-exceptions.com/blog/index.php/2008/11/24/autumn-of-agile-iteration-1-part-b-is-available/#comment-10687</guid>
		<description>@mynkow:

This will likely be happening within the next month at the latest, but as part of the process the namespaces will be changing to remove any reference to my employer.

This will be true of the Domain Foundation library as well as the Unit Test Utility.

Stay tuned for more info~!</description>
		<content:encoded><![CDATA[<p>@mynkow:</p>
<p>This will likely be happening within the next month at the latest, but as part of the process the namespaces will be changing to remove any reference to my employer.</p>
<p>This will be true of the Domain Foundation library as well as the Unit Test Utility.</p>
<p>Stay tuned for more info~!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mynkow</title>
		<link>http://unhandled-exceptions.com/blog/index.php/2008/11/24/autumn-of-agile-iteration-1-part-b-is-available/comment-page-1/#comment-10664</link>
		<dc:creator>mynkow</dc:creator>
		<pubDate>Wed, 11 Feb 2009 20:13:16 +0000</pubDate>
		<guid isPermaLink="false">http://unhandled-exceptions.com/blog/index.php/2008/11/24/autumn-of-agile-iteration-1-part-b-is-available/#comment-10664</guid>
		<description>Thank you very much for the help Steve!!!

There is one open question about Microdesk.Domain.Foundation. Before 3-4 months you said that there is a little hope your blog subscribers and all other people to have the source of this lib. What is the status?

And let the force be with you!</description>
		<content:encoded><![CDATA[<p>Thank you very much for the help Steve!!!</p>
<p>There is one open question about Microdesk.Domain.Foundation. Before 3-4 months you said that there is a little hope your blog subscribers and all other people to have the source of this lib. What is the status?</p>
<p>And let the force be with you!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sbohlen</title>
		<link>http://unhandled-exceptions.com/blog/index.php/2008/11/24/autumn-of-agile-iteration-1-part-b-is-available/comment-page-1/#comment-10662</link>
		<dc:creator>sbohlen</dc:creator>
		<pubDate>Wed, 11 Feb 2009 19:55:16 +0000</pubDate>
		<guid isPermaLink="false">http://unhandled-exceptions.com/blog/index.php/2008/11/24/autumn-of-agile-iteration-1-part-b-is-available/#comment-10662</guid>
		<description>@mynkow:

Glad to have helped.  As for you remainder exception stack there, try the Microdesk.Domain.Foundation.dll found in the last available code download and that issue is (should be) resolved in the binary for that found in the /lib/ folder of the download ZIP.

I screwed up and failed to define the base class' props as virtual until later -- my oversight!</description>
		<content:encoded><![CDATA[<p>@mynkow:</p>
<p>Glad to have helped.  As for you remainder exception stack there, try the Microdesk.Domain.Foundation.dll found in the last available code download and that issue is (should be) resolved in the binary for that found in the /lib/ folder of the download ZIP.</p>
<p>I screwed up and failed to define the base class&#8217; props as virtual until later &#8212; my oversight!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

