<?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>C.M. Jackson .Net &#187; design patterns</title>
	<atom:link href="http://www.cmjackson.net/tag/design-patterns/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.cmjackson.net</link>
	<description>Web Design, Programming, Tutorials</description>
	<lastBuildDate>Tue, 13 Dec 2011 17:38:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>The Repository Pattern</title>
		<link>http://www.cmjackson.net/2010/01/26/the-repository-pattern/</link>
		<comments>http://www.cmjackson.net/2010/01/26/the-repository-pattern/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 14:00:42 +0000</pubDate>
		<dc:creator>Chris Jackson</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[design patterns]]></category>

		<guid isPermaLink="false">http://www.cmjackson.net/?p=354</guid>
		<description><![CDATA[The repository pattern is a design pattern that creates repositories of data that talk to a data source. These repositories are used to segregate the code that talks to a data source from the rest of your program. For example, your code that communicates to a database connection is stored within a repository class. Communication [...]]]></description>
			<content:encoded><![CDATA[<p>The repository pattern is a design pattern that creates repositories of data that talk to a data source. These repositories are used to segregate the code that talks to a data source from the rest of your program. For example, your code that communicates to a database connection is stored within a repository class. Communication between your program and the database is all funnelled through the repository class.</p>
<p>In <a href="http://en.wikipedia.org/wiki/Domain_driven_design">Domain Driven Design</a>, you create data objects that are logical representations of the data stored within a data source; such as a database. These data objects may not mimic the design of a database, but instead be a more logical grouping of properties and methods. The repository pattern can be used to create a repository class for each data object, where that object can then be created, read,  updated, or deleted (CRUD) from the data source.</p>
<p>Using the repository pattern with <a href="http://en.wikipedia.org/wiki/Dependency_injection">Dependency Injection</a> allows for the repository class to be mocked during testing, where a more controlled and faster repository can be created. Also, if the data source changes to a XML file or another database, the repository class can be replaced.</p>
<p>The Repository pattern is one of the design patterns that I use to build a more maintainable and flexible application.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cmjackson.net/2010/01/26/the-repository-pattern/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

