<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Altug Sahin&#039;s Blog</title>
	<atom:link href="http://altugsahin.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://altugsahin.wordpress.com</link>
	<description>Broken clock, twice a day</description>
	<lastBuildDate>Sun, 08 Jan 2012 16:16:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='altugsahin.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/2f1759a693275eddd850a27ecd895c4b?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Altug Sahin&#039;s Blog</title>
		<link>http://altugsahin.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://altugsahin.wordpress.com/osd.xml" title="Altug Sahin&#039;s Blog" />
	<atom:link rel='hub' href='http://altugsahin.wordpress.com/?pushpress=hub'/>
		<item>
		<title>delete stale remote branches with git</title>
		<link>http://altugsahin.wordpress.com/2011/11/25/delete-stale-remote-branches-with-git/</link>
		<comments>http://altugsahin.wordpress.com/2011/11/25/delete-stale-remote-branches-with-git/#comments</comments>
		<pubDate>Fri, 25 Nov 2011 14:56:37 +0000</pubDate>
		<dc:creator>Altug Sahin</dc:creator>
				<category><![CDATA[git]]></category>
		<category><![CDATA[branching]]></category>
		<category><![CDATA[scm]]></category>

		<guid isPermaLink="false">http://altugsahin.wordpress.com/?p=391</guid>
		<description><![CDATA[You delete remote branches with git simply with: git push origin :branchname I noticed I see this deleted branch when I do git branch -a on my laptop. The way you delete the remote branch from your local list of remote branches is with this: git branch -rd origin/branchname References: http://help.github.com/remotes/ &#160;<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=altugsahin.wordpress.com&amp;blog=13254662&amp;post=391&amp;subd=altugsahin&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>You delete remote branches with git simply with:<br />
<code>git push origin :branchname</code></p>
<p>I noticed I see this deleted branch when I do <code>git branch -a</code> on my laptop. The way you delete the remote branch from your local list of remote branches is with this:</p>
<p><code>git branch -rd origin/branchname</code></p>
<h3>References:</h3>
<p><a href="http://help.github.com/remotes/">http://help.github.com/remotes/</a></p>
<p>&nbsp;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/altugsahin.wordpress.com/391/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/altugsahin.wordpress.com/391/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/altugsahin.wordpress.com/391/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/altugsahin.wordpress.com/391/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/altugsahin.wordpress.com/391/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/altugsahin.wordpress.com/391/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/altugsahin.wordpress.com/391/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/altugsahin.wordpress.com/391/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/altugsahin.wordpress.com/391/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/altugsahin.wordpress.com/391/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/altugsahin.wordpress.com/391/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/altugsahin.wordpress.com/391/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/altugsahin.wordpress.com/391/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/altugsahin.wordpress.com/391/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=altugsahin.wordpress.com&amp;blog=13254662&amp;post=391&amp;subd=altugsahin&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://altugsahin.wordpress.com/2011/11/25/delete-stale-remote-branches-with-git/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3aa0403ef5e4fe37475ec67e47360416?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">aecdev</media:title>
		</media:content>
	</item>
		<item>
		<title>FxCop error CA0001 on build server</title>
		<link>http://altugsahin.wordpress.com/2011/11/18/fxcop-error-ca0001-on-build-server/</link>
		<comments>http://altugsahin.wordpress.com/2011/11/18/fxcop-error-ca0001-on-build-server/#comments</comments>
		<pubDate>Fri, 18 Nov 2011 19:58:54 +0000</pubDate>
		<dc:creator>Altug Sahin</dc:creator>
				<category><![CDATA[build]]></category>
		<category><![CDATA[fxcop]]></category>

		<guid isPermaLink="false">http://altugsahin.wordpress.com/?p=384</guid>
		<description><![CDATA[My Windows 2003 TeamCity build server started acting up all of a sudden. The exception didn&#8217;t say a whole lot but it turned out I need to register msdia100.dll to shut it up. It resided on my dev machine here: &#8220;C:\Program Files\Microsoft Visual Studio 10.0\Common7\Packages\Debugger\msdia100.dll&#8221; Register this dll on your build machine as: regsvr32 msdia100.dll [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=altugsahin.wordpress.com&amp;blog=13254662&amp;post=384&amp;subd=altugsahin&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>My Windows 2003 TeamCity build server started acting up all of a sudden. The exception didn&#8217;t say a whole lot but it turned out I need to register msdia100.dll to shut it up. It resided on my dev machine here:<br />
&#8220;C:\Program Files\Microsoft Visual Studio 10.0\Common7\Packages\Debugger\msdia100.dll&#8221;</p>
<p>Register this dll on your build machine as:<br />
<code><br />
regsvr32 msdia100.dll<br />
</code><br />
Stack at the exception:<br />
<code><br />
Phx.FatalError<br />
Exception of type 'Phx.FatalError' was thrown.<br />
at Phx.FatalError.Dispatch()<br />
at Phx.Logging.Diagnostics.DiagnosticMessage.LogMessage(Severity severity, DiagnosticInfo diagnosticInfo, SourceContext sourceContext, String descriptionString)<br />
at Phx.PE.PEUtilities.UserError(String infoMessage)<br />
at Phx.Pdb.ReaderImplementation.Open(Boolean loadTypeOnly)<br />
at Phx.PEModuleUnit.LoadPdb()<br />
at Phx.PE.ReaderPhase.CheckSymbolicInformation()<br />
at Phx.PEModuleUnit.LoadGlobalSymbols()<br />
at Phx.PEModuleUnit.LoadEncodedIRUnitList()<br />
at Phx.PEModuleUnit.GetEnumerableContributionUnit()<br />
at Microsoft.FxCop.Engines.Phoenix.PreScanPass.GetFunctionUnits(PEModuleUnit peModuleUnit)<br />
at Microsoft.FxCop.Engines.Phoenix.PreScanPass.Execute(ModuleUnit moduleUnit)<br />
at Phx.Passes.PassList.DoPassList(ModuleUnit moduleUnit)<br />
at Microsoft.FxCop.Engines.Phoenix.PhoenixAnalysisEngine.AnalyzeInternal()<br />
at Microsoft.FxCop.Engines.Phoenix.PhoenixAnalysisEngine.Analyze()<br />
at Microsoft.FxCop.Common.EngineManager.Analyze(Project project, Boolean verboseOutput)</p>
<p></code></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/altugsahin.wordpress.com/384/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/altugsahin.wordpress.com/384/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/altugsahin.wordpress.com/384/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/altugsahin.wordpress.com/384/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/altugsahin.wordpress.com/384/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/altugsahin.wordpress.com/384/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/altugsahin.wordpress.com/384/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/altugsahin.wordpress.com/384/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/altugsahin.wordpress.com/384/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/altugsahin.wordpress.com/384/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/altugsahin.wordpress.com/384/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/altugsahin.wordpress.com/384/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/altugsahin.wordpress.com/384/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/altugsahin.wordpress.com/384/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=altugsahin.wordpress.com&amp;blog=13254662&amp;post=384&amp;subd=altugsahin&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://altugsahin.wordpress.com/2011/11/18/fxcop-error-ca0001-on-build-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3aa0403ef5e4fe37475ec67e47360416?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">aecdev</media:title>
		</media:content>
	</item>
		<item>
		<title>Simplest git repository setup on windows server</title>
		<link>http://altugsahin.wordpress.com/2011/10/28/simplest-git-repository-setup-on-windows-server/</link>
		<comments>http://altugsahin.wordpress.com/2011/10/28/simplest-git-repository-setup-on-windows-server/#comments</comments>
		<pubDate>Fri, 28 Oct 2011 19:13:59 +0000</pubDate>
		<dc:creator>Altug Sahin</dc:creator>
				<category><![CDATA[git]]></category>
		<category><![CDATA[setup]]></category>

		<guid isPermaLink="false">http://altugsahin.wordpress.com/?p=362</guid>
		<description><![CDATA[Git is awesome, you should know that. I had to setup a central git repository for a small team in a Windows shop. The simplest setup to get started is as follows. On the Windows Server: Install git (http://code.google.com/p/msysgit) Create and share a folder where you will use it as central repository (C:\repositories\myproject). Setup whatever [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=altugsahin.wordpress.com&amp;blog=13254662&amp;post=362&amp;subd=altugsahin&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Git is awesome, you should know that. I had to setup a central git repository for a small team in a Windows shop. The simplest setup to get started is as follows.</p>
<h3>On the Windows Server:</h3>
<ul>
<li>Install git (<a href="http://code.google.com/p/msysgit">http://code.google.com/p/msysgit</a>)</li>
<li>Create and share a folder where you will use it as central repository (C:\repositories\myproject). Setup whatever permissions you want to setup on the shared folder.</li>
<li>Run git bash and:</li>
</ul>
<p><code>cd myproject<br />
git init --bare</code></p>
<h3>On your Windows Workstation</h3>
<ul>
<li>Map the shared folder (mypoject) on the server to a drive (ie: z) on your workstation</li>
<li>Install git (<a href="http://code.google.com/p/msysgit">http://code.google.com/p/msysgit</a>)</li>
<li>Create a folder where you will work on the project.</li>
<li>Run git bash and:</li>
</ul>
<p><code> cd /c/projects<br />
mkdir myproject<br />
cd myproject<br />
git init<br />
touch readme.txt<br />
notepad readme.txt # add some content<br />
git add -A<br />
git commit -m 'initial checkin'<br />
git remote add origin file:///z/repositories/myproject<br />
git push origin master<br />
git branch -a<br />
</code></p>
<p>This is it&#8230;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/altugsahin.wordpress.com/362/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/altugsahin.wordpress.com/362/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/altugsahin.wordpress.com/362/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/altugsahin.wordpress.com/362/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/altugsahin.wordpress.com/362/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/altugsahin.wordpress.com/362/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/altugsahin.wordpress.com/362/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/altugsahin.wordpress.com/362/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/altugsahin.wordpress.com/362/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/altugsahin.wordpress.com/362/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/altugsahin.wordpress.com/362/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/altugsahin.wordpress.com/362/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/altugsahin.wordpress.com/362/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/altugsahin.wordpress.com/362/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=altugsahin.wordpress.com&amp;blog=13254662&amp;post=362&amp;subd=altugsahin&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://altugsahin.wordpress.com/2011/10/28/simplest-git-repository-setup-on-windows-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3aa0403ef5e4fe37475ec67e47360416?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">aecdev</media:title>
		</media:content>
	</item>
		<item>
		<title>Repository Pattern – Part Four</title>
		<link>http://altugsahin.wordpress.com/2011/06/15/repository-pattern-%e2%80%93-part-four/</link>
		<comments>http://altugsahin.wordpress.com/2011/06/15/repository-pattern-%e2%80%93-part-four/#comments</comments>
		<pubDate>Wed, 15 Jun 2011 12:09:23 +0000</pubDate>
		<dc:creator>Altug Sahin</dc:creator>
				<category><![CDATA[design patterns]]></category>
		<category><![CDATA[repository pattern]]></category>

		<guid isPermaLink="false">http://altugsahin.wordpress.com/?p=318</guid>
		<description><![CDATA[If you like to take a look at previous posts, here they are: Part 1 Part 2 Part 3 There are few things I&#8217;d like to do to evolve the repositories. Use Linq for specifications Introduce Unit of Work (UoW) Linq for specifications I used specification objects to build specifications to create query criterion previously. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=altugsahin.wordpress.com&amp;blog=13254662&amp;post=318&amp;subd=altugsahin&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you like to take a look at previous posts, here they are:</p>
<ul>
<li><a title="Repository Pattern – Part One" href="http://altugsahin.wordpress.com/2010/04/25/repository-pattern-part-one-introduction/">Part 1</a></li>
<li><a title="Repository Pattern – Part Two" href="http://altugsahin.wordpress.com/2010/05/03/repository-pattern-part-two/">Part 2</a></li>
<li><a title="Repository Pattern – Part Three" href="http://altugsahin.wordpress.com/2010/06/06/repository-pattern-part-three/">Part 3</a></li>
</ul>
<p>There are few things I&#8217;d like to do to evolve the repositories.</p>
<ul>
<li>Use Linq for specifications</li>
<li>Introduce Unit of Work (UoW)</li>
</ul>
<h2>Linq for specifications</h2>
<p>I used specification objects to build specifications to create query criterion <a title="Repository Pattern – Part Three" href="http://altugsahin.wordpress.com/2010/06/06/repository-pattern-part-three/">previously</a>. I had to use specification objects to describe the criteria. This may be OK but when the number of criterion increases, management of these specification classes will be an overhead.</p>
<p>We can use Linq and Expressions in favor of our own explicit specifications. Given the popularity and acceptance of Linq, your data store will most likely support Linq in its API so your expressions in your criteria will play nicely.</p>
<p>I like to first separate the query and update portions of the repository. This allows us to be granular. Separating commands and queries from the repository gives me flexibility. I can inject query into controllers which does nothing but querying the data store and building a view model. I can send commands to a message bus and handler of that command can depend on the IUpdateModel contract to persist. The query side may even be in the cache. This is a way to enable CQS (Command Query Seperation) in your domain.</p>
<p>I made the repository non generic and added type parameters to its methods. This makes injecting repositories easier into dependent components.</p>
<p>There is a <a href="http://code.google.com/p/linq-specifications/">linq specifications</a> project at google code if like to use a linq based specification for the previously discussed explicit specification solution in <a title="Repository Pattern – Part Three" href="http://altugsahin.wordpress.com/2010/06/06/repository-pattern-part-three/">part 3</a>.</p>
<h2>Unit Of Work</h2>
<p>There are lots of materials you can find on the subject. Here are some links to get started&#8230;</p>
<ul>
<li><a href="http://martinfowler.com/eaaCatalog/unitOfWork.html">Martin Fowler</a></li>
<li><a href="http://msdn.microsoft.com/en-us/magazine/dd882510.aspx">MSDN article from Jeremy Miller</a></li>
<li><a href="http://blogs.msdn.com/b/adonet/archive/2009/06/16/using-repository-and-unit-of-work-patterns-with-entity-framework-4-0.aspx">Implementing Unit of Work with Entity Framework</a></li>
</ul>
<p>One think you should be aware is that most data access tools you use (NHibernate, Linq To Sql, Entity Framwork, etc&#8230;) already utilize the unit of work pattern. NHibernate uses ISession and the latter two uses DataContext. They are all &#8220;units of work&#8221; which tracks changes to entities within its scope.</p>
<p>In this example, I used entity framework for persistence. The domain repository will be using that. The unit of work implementation follows the domain below.</p>
<p><pre class="brush: csharp;">
public interface IQueryModel
{
	TEntity Get&lt;TEntity&gt;(Func&lt;TEntity, bool&gt; where) where TEntity : class;
	IEnumerable&lt;TEntity&gt; GetMany&lt;TEntity&gt;(Func&lt;TEntity, bool&gt; where) where TEntity : class;
	IEnumerable&lt;TEntity&gt; GetAll&lt;TEntity&gt;() where TEntity : class;
}

public interface IUpdateModel
{
	void Save&lt;TEntity&gt;(TEntity dto) where TEntity : class;
	void Update&lt;TEntity&gt;(TEntity entity) where TEntity : class;
	void Delete&lt;TEntity&gt;(Func&lt;TEntity, bool&gt; predicate) where TEntity : class;
	void Delete&lt;TEntity&gt;(TEntity entity) where TEntity : class;
}

public interface IRepository : IQueryModel, IUpdateModel
{
}

public interface IPersistData
{
	void Persist();
	IPersistData New();
}

// Entity framework dependent data persister
public class EfDataContext : DbContext, IPersistData
{
	public DbSet&lt;User&gt; Users { get; set; }

	public EfDataContext()
		: base(&quot;RepositorySeries&quot;)
	{
	}

	#region Implementation of IPersistData

	public void Persist()
	{
		SaveChanges();
	}

	public IPersistData New()
	{
		return new EfDataContext();
	}

	#endregion
}

// simple entity
public class User
{
	[Key]
	public int UserID { get; set; }
	public string FullName { get; set; }
}

// Entity framework dependent repository
public class DomainRepository : IRepository
{
	private DbContext m_db;

	public DomainRepository(DbContext db)
	{
		m_db = db;
	}
	public DomainRepository()
	{
		m_db = new EfDataContext();
	}

	#region Implementation of IQueryModel

	public TEntity Get&lt;TEntity&gt;(Func&lt;TEntity, bool&gt; where) where TEntity : class
	{
		return m_db.Set&lt;TEntity&gt;().FirstOrDefault(where);
	}

	public IEnumerable&lt;TEntity&gt; GetMany&lt;TEntity&gt;(Func&lt;TEntity, bool&gt; where) where TEntity : class
	{
		return m_db.Set&lt;TEntity&gt;().Where(where);
	}

	public IEnumerable&lt;TEntity&gt; GetAll&lt;TEntity&gt;() where TEntity : class
	{
		return m_db.Set&lt;TEntity&gt;();
	}

	#endregion

	#region Implementation of IUpdateModel

	public void Save&lt;TEntity&gt;(TEntity dto) where TEntity : class
	{
		m_db.Set&lt;TEntity&gt;().Add(dto);
	}

	public void Update&lt;TEntity&gt;(TEntity entity) where TEntity : class
	{
		m_db.Entry(entity).State = EntityState.Modified;
	}

	public void Delete&lt;TEntity&gt;(Func&lt;TEntity, bool&gt; predicate) where TEntity : class
	{
		var entity = m_db.Set&lt;TEntity&gt;().FirstOrDefault(predicate);

		m_db.Set&lt;TEntity&gt;().Remove(entity);
	}

	public void Delete&lt;TEntity&gt;(TEntity entity) where TEntity : class
	{
		m_db.Set&lt;TEntity&gt;().Remove(entity);
	}

	#endregion

	#region Implementation of IRepository

	public void Commit()
	{
		m_db.SaveChanges();
	}

	public void Rollback()
	{
		m_db = new EfDataContext();
	}

	#endregion
}

public interface IUnitOfWork
{
	IRepository Repository { get; }
	void Commit();
	void Rollback();
}

public class UnitOfWork : IUnitOfWork
{
	private IPersistData m_db;

	public UnitOfWork(IRepository repository, IPersistData db)
	{
		m_db = db;
		Repository = repository;
	}

	#region Implementation of IUnitOfWork

	public IRepository Repository { get; private set; }

	public void Commit()
	{
		try
		{
			m_db.Persist();
		}
		catch (Exception ex)
		{
			Rollback();

			throw ex;
		}
	}

	public void Rollback()
	{
		m_db = m_db.New();
	}

	#endregion
}

// sample app using all above
class Program
{
	static void Main(string[] args)
	{
		// get these from container (DI)
		IRepository repository = new DomainRepository();
		IPersistData db = new EfDataContext();

		// unit of work object
		var uow = new UnitOfWork(repository, db);

		// sample entity
		var u1 = new User { FullName = &quot;Homer Simpson&quot;, };

		// add, edit, delete entities on the repository
		uow.Repository.Save(u1);

		// commit changes in unit of work
		uow.Commit();
	}
}
</pre></p>
<p>The interfaces and unit of work implementation does not have any dependency to a data access technology. DomainRepository and EfDataContext have dependencies to Entity Framework in this case. This implementation can be changed to some other data access technology easily.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/altugsahin.wordpress.com/318/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/altugsahin.wordpress.com/318/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/altugsahin.wordpress.com/318/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/altugsahin.wordpress.com/318/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/altugsahin.wordpress.com/318/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/altugsahin.wordpress.com/318/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/altugsahin.wordpress.com/318/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/altugsahin.wordpress.com/318/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/altugsahin.wordpress.com/318/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/altugsahin.wordpress.com/318/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/altugsahin.wordpress.com/318/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/altugsahin.wordpress.com/318/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/altugsahin.wordpress.com/318/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/altugsahin.wordpress.com/318/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=altugsahin.wordpress.com&amp;blog=13254662&amp;post=318&amp;subd=altugsahin&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://altugsahin.wordpress.com/2011/06/15/repository-pattern-%e2%80%93-part-four/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3aa0403ef5e4fe37475ec67e47360416?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">aecdev</media:title>
		</media:content>
	</item>
		<item>
		<title>python interactive console intellisense</title>
		<link>http://altugsahin.wordpress.com/2011/01/20/python-interactive-console-intellisense/</link>
		<comments>http://altugsahin.wordpress.com/2011/01/20/python-interactive-console-intellisense/#comments</comments>
		<pubDate>Thu, 20 Jan 2011 19:34:03 +0000</pubDate>
		<dc:creator>Altug Sahin</dc:creator>
				<category><![CDATA[python]]></category>
		<category><![CDATA[tips and tricks]]></category>

		<guid isPermaLink="false">http://altugsahin.wordpress.com/?p=315</guid>
		<description><![CDATA[Great tip! http://fernandotakai.wordpress.com/2008/06/17/adding-autocomplete-to-a-python-console/<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=altugsahin.wordpress.com&amp;blog=13254662&amp;post=315&amp;subd=altugsahin&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Great tip!</p>
<p><a href="http://fernandotakai.wordpress.com/2008/06/17/adding-autocomplete-to-a-python-console/">http://fernandotakai.wordpress.com/2008/06/17/adding-autocomplete-to-a-python-console/</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/altugsahin.wordpress.com/315/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/altugsahin.wordpress.com/315/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/altugsahin.wordpress.com/315/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/altugsahin.wordpress.com/315/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/altugsahin.wordpress.com/315/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/altugsahin.wordpress.com/315/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/altugsahin.wordpress.com/315/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/altugsahin.wordpress.com/315/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/altugsahin.wordpress.com/315/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/altugsahin.wordpress.com/315/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/altugsahin.wordpress.com/315/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/altugsahin.wordpress.com/315/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/altugsahin.wordpress.com/315/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/altugsahin.wordpress.com/315/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=altugsahin.wordpress.com&amp;blog=13254662&amp;post=315&amp;subd=altugsahin&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://altugsahin.wordpress.com/2011/01/20/python-interactive-console-intellisense/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3aa0403ef5e4fe37475ec67e47360416?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">aecdev</media:title>
		</media:content>
	</item>
		<item>
		<title>git add nuances</title>
		<link>http://altugsahin.wordpress.com/2010/11/30/git-add-nuances/</link>
		<comments>http://altugsahin.wordpress.com/2010/11/30/git-add-nuances/#comments</comments>
		<pubDate>Tue, 30 Nov 2010 12:34:54 +0000</pubDate>
		<dc:creator>Altug Sahin</dc:creator>
				<category><![CDATA[tips and tricks]]></category>
		<category><![CDATA[git]]></category>

		<guid isPermaLink="false">http://altugsahin.wordpress.com/?p=312</guid>
		<description><![CDATA[As a git newbie, I keep forgetting the difference between &#8220;git add .&#8221; and &#8220;git add -A&#8221;. git add -A stages All git add . stages new and modified, without deleted git add -u stages modified and updated, without new http://help.github.com/git-cheat-sheets/<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=altugsahin.wordpress.com&amp;blog=13254662&amp;post=312&amp;subd=altugsahin&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>As a git newbie, I keep forgetting the difference between &#8220;git add .&#8221; and &#8220;git add -A&#8221;.</p>
<ul>
<li><code>git add -A</code> <em>stages <strong>All</strong></em></li>
<li><code>git add .</code> <em>stages new and modified, <strong>without deleted</strong></em></li>
<li><code>git add -u</code> <em>stages modified and updated, <strong>without new</strong></em></li>
</ul>
<p><a href="http://help.github.com/git-cheat-sheets/">http://help.github.com/git-cheat-sheets/</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/altugsahin.wordpress.com/312/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/altugsahin.wordpress.com/312/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/altugsahin.wordpress.com/312/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/altugsahin.wordpress.com/312/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/altugsahin.wordpress.com/312/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/altugsahin.wordpress.com/312/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/altugsahin.wordpress.com/312/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/altugsahin.wordpress.com/312/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/altugsahin.wordpress.com/312/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/altugsahin.wordpress.com/312/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/altugsahin.wordpress.com/312/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/altugsahin.wordpress.com/312/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/altugsahin.wordpress.com/312/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/altugsahin.wordpress.com/312/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=altugsahin.wordpress.com&amp;blog=13254662&amp;post=312&amp;subd=altugsahin&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://altugsahin.wordpress.com/2010/11/30/git-add-nuances/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3aa0403ef5e4fe37475ec67e47360416?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">aecdev</media:title>
		</media:content>
	</item>
		<item>
		<title>node.js installation in ubuntu</title>
		<link>http://altugsahin.wordpress.com/2010/11/23/node-js-installation-in-ubuntu/</link>
		<comments>http://altugsahin.wordpress.com/2010/11/23/node-js-installation-in-ubuntu/#comments</comments>
		<pubDate>Tue, 23 Nov 2010 21:29:41 +0000</pubDate>
		<dc:creator>Altug Sahin</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[node.js]]></category>

		<guid isPermaLink="false">http://altugsahin.wordpress.com/?p=307</guid>
		<description><![CDATA[You can clone the git repository and build it or simply do this: sudo add-apt-repository ppa:jerome-etienne/neoip sudo apt-get update &#38;&#38; sudo apt-get install nodejs<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=altugsahin.wordpress.com&amp;blog=13254662&amp;post=307&amp;subd=altugsahin&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>You can clone the git repository and build it or simply do this:</p>
<p><code>sudo add-apt-repository ppa:jerome-etienne/neoip<br />
</code><span style="font-family:monospace;">sudo apt-get update &amp;&amp; sudo apt-get install nodejs</span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/altugsahin.wordpress.com/307/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/altugsahin.wordpress.com/307/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/altugsahin.wordpress.com/307/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/altugsahin.wordpress.com/307/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/altugsahin.wordpress.com/307/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/altugsahin.wordpress.com/307/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/altugsahin.wordpress.com/307/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/altugsahin.wordpress.com/307/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/altugsahin.wordpress.com/307/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/altugsahin.wordpress.com/307/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/altugsahin.wordpress.com/307/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/altugsahin.wordpress.com/307/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/altugsahin.wordpress.com/307/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/altugsahin.wordpress.com/307/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=altugsahin.wordpress.com&amp;blog=13254662&amp;post=307&amp;subd=altugsahin&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://altugsahin.wordpress.com/2010/11/23/node-js-installation-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3aa0403ef5e4fe37475ec67e47360416?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">aecdev</media:title>
		</media:content>
	</item>
		<item>
		<title>Rails 3 Console Error</title>
		<link>http://altugsahin.wordpress.com/2010/11/13/rails-3-console-error/</link>
		<comments>http://altugsahin.wordpress.com/2010/11/13/rails-3-console-error/#comments</comments>
		<pubDate>Sat, 13 Nov 2010 11:47:13 +0000</pubDate>
		<dc:creator>Altug Sahin</dc:creator>
				<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[tips and tricks]]></category>
		<category><![CDATA[console]]></category>
		<category><![CDATA[installation]]></category>

		<guid isPermaLink="false">http://altugsahin.wordpress.com/?p=303</guid>
		<description><![CDATA[I could not start the rails console while I was in the project directory with: rails c Issue was with readline and ncurses libraries. Go to ~/.rvm/src/ruby-1.9.2-p0/ext/readline ruby extconf.rb make make install That should do it&#8230;<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=altugsahin.wordpress.com&amp;blog=13254662&amp;post=303&amp;subd=altugsahin&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I could not start the rails console while I was in the project directory with:</p>
<p><code>rails c</code></p>
<p>Issue was with readline and ncurses libraries. Go to</p>
<p><code>~/.rvm/src/ruby-1.9.2-p0/ext/readline</code><br />
<code>ruby extconf.rb</code><br />
<code>make</code><br />
<code>make install</code></p>
<p>That should do it&#8230;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/altugsahin.wordpress.com/303/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/altugsahin.wordpress.com/303/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/altugsahin.wordpress.com/303/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/altugsahin.wordpress.com/303/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/altugsahin.wordpress.com/303/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/altugsahin.wordpress.com/303/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/altugsahin.wordpress.com/303/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/altugsahin.wordpress.com/303/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/altugsahin.wordpress.com/303/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/altugsahin.wordpress.com/303/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/altugsahin.wordpress.com/303/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/altugsahin.wordpress.com/303/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/altugsahin.wordpress.com/303/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/altugsahin.wordpress.com/303/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=altugsahin.wordpress.com&amp;blog=13254662&amp;post=303&amp;subd=altugsahin&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://altugsahin.wordpress.com/2010/11/13/rails-3-console-error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3aa0403ef5e4fe37475ec67e47360416?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">aecdev</media:title>
		</media:content>
	</item>
		<item>
		<title>webmin installation on ubuntu</title>
		<link>http://altugsahin.wordpress.com/2010/11/12/webmin-installation-on-ubuntu/</link>
		<comments>http://altugsahin.wordpress.com/2010/11/12/webmin-installation-on-ubuntu/#comments</comments>
		<pubDate>Fri, 12 Nov 2010 15:17:48 +0000</pubDate>
		<dc:creator>Altug Sahin</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[tips and tricks]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[webmin]]></category>

		<guid isPermaLink="false">http://altugsahin.wordpress.com/?p=298</guid>
		<description><![CDATA[Edit repository list, update apt-get, get the key and install webmin. sudo vim etc/apt/sources.list deb http://download.webmin.com/download/repository sarge contrib wget http://www.webmin.com/jcameron-key.asc sudo apt-key add jcameron-key.asc apt-get update apt-get install webmin https://localhost:10000<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=altugsahin.wordpress.com&amp;blog=13254662&amp;post=298&amp;subd=altugsahin&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Edit repository list, update apt-get, get the key and install webmin.</p>
<p><code>sudo vim etc/apt/sources.list</code><br />
<span style="font-family:monospace;">deb http://download.webmin.com/download/repository sarge contrib</span><br />
<span style="font-family:monospace;">wget http://www.webmin.com/jcameron-key.asc</span><br />
<span style="font-family:monospace;">sudo apt-key add jcameron-key.asc</span><br />
<span style="font-family:monospace;">apt-get update</span><br />
<span style="font-family:monospace;">apt-get install webmin</span><br />
<span style="font-family:monospace;">https://localhost:10000</span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/altugsahin.wordpress.com/298/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/altugsahin.wordpress.com/298/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/altugsahin.wordpress.com/298/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/altugsahin.wordpress.com/298/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/altugsahin.wordpress.com/298/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/altugsahin.wordpress.com/298/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/altugsahin.wordpress.com/298/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/altugsahin.wordpress.com/298/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/altugsahin.wordpress.com/298/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/altugsahin.wordpress.com/298/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/altugsahin.wordpress.com/298/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/altugsahin.wordpress.com/298/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/altugsahin.wordpress.com/298/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/altugsahin.wordpress.com/298/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=altugsahin.wordpress.com&amp;blog=13254662&amp;post=298&amp;subd=altugsahin&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://altugsahin.wordpress.com/2010/11/12/webmin-installation-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3aa0403ef5e4fe37475ec67e47360416?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">aecdev</media:title>
		</media:content>
	</item>
		<item>
		<title>Natural Language Processing Terminology</title>
		<link>http://altugsahin.wordpress.com/2010/10/20/natural-language-processing-terminology/</link>
		<comments>http://altugsahin.wordpress.com/2010/10/20/natural-language-processing-terminology/#comments</comments>
		<pubDate>Wed, 20 Oct 2010 21:34:33 +0000</pubDate>
		<dc:creator>Altug Sahin</dc:creator>
				<category><![CDATA[natual language processing]]></category>
		<category><![CDATA[nlp]]></category>

		<guid isPermaLink="false">http://altugsahin.wordpress.com/?p=255</guid>
		<description><![CDATA[Generic terminology about NLP (Natural Language Processing): Collocation - A collocation is a sequence of words that occur together unusually often. Thus red wine is a collocation, whereas the wine is not. A characteristic of collocations is that they are resistant to substitution with words that have similar senses; for example, maroon wine sounds very odd. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=altugsahin.wordpress.com&amp;blog=13254662&amp;post=255&amp;subd=altugsahin&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Generic terminology about NLP (Natural Language Processing):</p>
<ul>
<li><strong>Collocation</strong> - A collocation is a sequence of words that occur together unusually often. Thus <em>red wine</em> is a collocation, whereas <em>the wine</em> is not. A characteristic of collocations is that they are resistant to substitution with words that have similar senses; for example, <em>maroon wine</em> sounds very odd.</li>
<li><strong>Bigram</strong> &#8211; Word pairs; such as &#8220;<em>red wine</em>&#8220;.</li>
<li><strong>Corpus</strong> (plural <em>corpora</em>) or <strong>text corpus</strong> is a large and structured set of texts (now usually electronically stored and processed). They are used to do statistical analysis and <a title="Statistical hypothesis testing" href="http://en.wikipedia.org/wiki/Statistical_hypothesis_testing">hypothesis testing</a>, checking occurrences or validating linguistic rules on a specific universe.</li>
<li><strong>Entropy</strong> is a measure of the uncertainty associated with a random variable. The term by itself in this context usually refers to the Shannon entropy. Shannon entropy is a measure of disorder, or more precisely unpredictability. For example, a series of coin tosses with a fair coin has maximum entropy, since there is no way to predict what will come next. A string of coin tosses with a two-headed coin has zero entropy, since the coin will always come up heads. Most collections of data in the real world lie somewhere in between.</li>
<li><strong>Maximum Entropy Modelling</strong> &#8211; General-purpose machine learning technique. When characterizing some unknown events with a statistical model, we should always choose the one that has Maximum Entropy. Maximum entropy modeling is a general-purpose machine learning technique originally developed for statistical physics, but which has been employed in a wide variety of fields, including computer vision and natural language processing. It can be usefully applied whenever there is a complex process whose internals are unknown but which must be modeled by the computer. Like any statistical modeling technique, it relies on the existence of a data sample that shows, for given sets of input, what output the process generates. This sample is analysed, and from it, a model is generated, encapsulating all the rules about the process that could be inferred from the sample. This model is then used to predict the output of the process, when supplied with sets of input not found in the sample data. (<a href="http://www.cs.jhu.edu/~hajic/courses/cs465/cs46520/ppframe.htm">Presentation</a>)</li>
<li><strong>Conditional Frequency Distribution</strong> &#8211; Collection of frequency distributions, each one for a different “condition.” The condition will often be the category of the text. A frequency distribution counts observable events, such as the appearance of words ina text. A conditional frequency distribution needs to pair each event with a condition.</li>
<li><strong>Semantic Network</strong> &#8211; Represents semantic relations among concepts. This is often used as a form of knowledge representation. It is a directed or undirected graph consisting of vertices, which represent concepts, and edges.</li>
<li><strong>Language Resource</strong> &#8211; Refers to data-only resources such as lexicons, corpora, thesauri or ontologies.</li>
<li><strong>Morpheme</strong> &#8211; The smallest component of word, or other linguistic unit, that has semantic meaning. The term is used as part of the branch of linguistics known as morpheme-based morphology. A morpheme is composed by phoneme(s) (the smallest linguistically distinctive units of sound) in spoken language, and by grapheme(s) (the smallest units of written language) in written language.</li>
<li><strong>Ontology</strong> &#8211; Formal representation of a set of concepts within a domain and the relationships between those concepts. It is used to reason about the properties of that domain, and may be used to define the domain.</li>
<li><strong>Anaphora</strong> - Instance of an expression referring to another. <em>The monkey took the banana and ate it.</em> &#8220;It&#8221; is anaphoric under the strict definition (it refers to the banana).</li>
<li><strong>Lexicon</strong> of a language is its vocabulary, including its words and expressions.</li>
<li><strong>Lexeme</strong> is an abstract unit of morphological analysis in linguistics, that roughly corresponds to a set of forms taken by a single word. For example, in the English language, <em>run</em>, <em>runs</em>, <em>ran</em> and <em>running</em> are forms of the same lexeme, conventionally written as run.</li>
<li><strong>Lemma</strong> is the canonical form of a lexeme. <em>Lexeme</em>, in this context, refers to the set of all the forms that have the same meaning, and <em>lemma</em> refers to the particular form that is chosen by convention to represent the lexeme.</li>
<li><strong>Coreference</strong> &#8211; It occurs when multiple expressions in a sentence or document refer to the same thing; or in linguistic jargon, they have the same &#8220;referent.&#8221; For example, in the sentence &#8220;Mary said she would help me&#8221;, &#8220;she&#8221; and &#8220;Mary&#8221; are most likely referring to the same person or group, in which case they are <em>coreferent</em>. Similarly, in &#8220;I saw Scott yesterday. He was fishing by the lake,&#8221; <em>Scott</em> and <em>he</em> are most likely coreferent.</li>
<li><strong>POS Tagging</strong> &#8211; The process of classifying words into their parts-of-speech and labeling them accordingly is known as part-of-speech tagging, POS tagging, or simply tagging. Parts-of-speech are also known as word classes or lexical categories. The collection of tagsused for a particular task is known as a tagset.</li>
</ul>
<ul>
<li><strong>tf–idf</strong> weight (term frequency–inverse document frequency) is a weight often used in information retrieval and text mining. This weight is a statistical measure used to evaluate how important a word is to a document in a collection or corpus. The importance increases proportionally to the number of times a word appears in the document but is offset by  the frequency of the word in the corpus. Variations of the tf–idf  weighting scheme are often used by search engines as a central tool in scoring and ranking a document&#8217;s relevance given a user query. One of the simplest ranking functions is computed by summing the tf-idf for each query term; many more  sophisticated ranking functions are variants of this simple model.
<ul></ul>
</li>
</ul>
<p>I will be updating this list as I encounter them&#8230;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/altugsahin.wordpress.com/255/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/altugsahin.wordpress.com/255/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/altugsahin.wordpress.com/255/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/altugsahin.wordpress.com/255/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/altugsahin.wordpress.com/255/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/altugsahin.wordpress.com/255/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/altugsahin.wordpress.com/255/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/altugsahin.wordpress.com/255/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/altugsahin.wordpress.com/255/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/altugsahin.wordpress.com/255/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/altugsahin.wordpress.com/255/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/altugsahin.wordpress.com/255/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/altugsahin.wordpress.com/255/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/altugsahin.wordpress.com/255/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=altugsahin.wordpress.com&amp;blog=13254662&amp;post=255&amp;subd=altugsahin&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://altugsahin.wordpress.com/2010/10/20/natural-language-processing-terminology/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3aa0403ef5e4fe37475ec67e47360416?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">aecdev</media:title>
		</media:content>
	</item>
	</channel>
</rss>
