<?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>blog.dervalp.com &#187; SoC</title>
	<atom:link href="http://blog.dervalp.com/tag/soc/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.dervalp.com</link>
	<description>Think before Programming (Public learning)</description>
	<lastBuildDate>Sat, 20 Mar 2010 22:22:42 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Kiwi MVC.NET : Building the application Part1</title>
		<link>http://blog.dervalp.com/2009/05/08/kiwi-mvc-building-the-application-part1/</link>
		<comments>http://blog.dervalp.com/2009/05/08/kiwi-mvc-building-the-application-part1/#comments</comments>
		<pubDate>Fri, 08 May 2009 14:57:39 +0000</pubDate>
		<dc:creator>dervalp</dc:creator>
				<category><![CDATA[Kiwi MVC]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[C#.NET]]></category>
		<category><![CDATA[CMS]]></category>
		<category><![CDATA[MVC.NET]]></category>
		<category><![CDATA[SoC]]></category>
		<category><![CDATA[TDD]]></category>

		<guid isPermaLink="false">http://www.blog.dervalp.com/?p=7</guid>
		<description><![CDATA[In this part, I am going to explain you how to setup an MVC .Net application.
I will tell you often &#8220;I am not a senior .Net developer&#8221;, I assume that I can make some faults and have totally wrong. If you think I am, do not hesitate to contact me at pierre@dervalp.com or leave me [...]]]></description>
			<content:encoded><![CDATA[<p>In this part, I am going to explain you how to setup an MVC .Net application.</p>
<p>I will tell you often &#8220;I am not a senior .Net developer&#8221;, I assume that I can make some faults and have totally wrong. If you think I am, do not hesitate to contact me at <a href="mailto:pierre@dervalp.com">pierre@dervalp.com</a> or leave me a comment in this blog. I would enjoy discussing with you. I am open-mind and I know I am far to know everything in software development. This blog would pretend to help people like me to find their way to make a MVC application using TDD and implement some well-known patterns.</p>
<h2><span id="more-7"></span></h2>
<h2>1.       Configuration</h2>
<p>Before you can start building websites with ASP.NET MVC, you need to install the following free software:</p>
<ul>
<li><!--[if !supportLists]--><span>.NET Framework version 3.5 with Service Pack 1</span></li>
<li><span>Visual Web Developer 2008 Express with Service Pack 1 </span></li>
<li><span style="font-size: 11pt; line-height: 115%; font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;;">ASP.NET MVC 1.0</span></li>
</ul>
<p>You can also download the Microsoft Webforms installer 2.0 beta which is a nice tool.</p>
<h2>2.       What is MVC Framework</h2>
<p>Microsoft is certainly better than me to explain this, so here is what they say:</p>
<p>ASP.NET MVC is a free and fully supported Microsoft framework for building web applications that use a model-view-controller pattern. Like ASP.NET Web Forms, ASP.NET MVC is built on the ASP.NET framework.</p>
<p>ASP.NET MVC provides the following benefits:</p>
<ul class="unIndentedList">
<li> Clear separation of concerns</li>
<li> Testability &#8211; support for Test-Driven Development</li>
<li> Fine-grained control over HTML and JavaScript</li>
<li> Intuitive URLs</li>
</ul>
<p>If you would like to know more in the pattern model-view-controller, I invite you to read these links (if you have others interesting link, please contact me and I will edit this post):</p>
<p>-          <a href="http://en.wikipedia.org/wiki/Model-view-controller">http://en.wikipedia.org/wiki/Model-view-controller</a></p>
<p>-          <a href="http://msdn.microsoft.com/en-us/library/ms978748.aspx">http://msdn.microsoft.com/en-us/library/ms978748.aspx</a></p>
<p><img class="aligncenter size-full wp-image-19" title="kiwi1-1" src="http://www.blog.dervalp.com/wp-content/uploads/2009/05/kiwi1-1.jpg" alt="kiwi1-1" width="322" height="163" /></p>
<h2>3.       Hey oh let&#8217;s go!</h2>
<p>I know I will not work under source control, we will see that later if I needed.</p>
<p>First step, Start you visual studio 2008, File -&gt; new -&gt; Project</p>
<p>You receive this tab:</p>
<p>-          I decided to call my CMS Kiwi because it sounds sunny and funny.</p>
<p>Name: Kiwi.MVC.web. I would take a pseudo naming convention for this project. I do not know if it is the better but if it does not fit in the future, we&#8217;ll change it but I do not think it is the most important thing for the moment.</p>
<p>Location: Personally, I work with an external hard drive where I put my sources. As I do not work in source control, I take a back-up every day and I send it to my Gmail. I know it&#8217;s a bit dirty&#8230;</p>
<p><img class="aligncenter size-full wp-image-22" title="kiwi1-2" src="http://www.blog.dervalp.com/wp-content/uploads/2009/05/kiwi1-2.jpg" alt="kiwi1-2" width="628" height="452" /></p>
<p>So, I create the project and VS pops up a window about creating a Unit Test Project:</p>
<p>This project will receive all my unit tests during the development</p>
<p>I change the name to /*My project name*/.MVC.Tests and let&#8217;s go&#8230;</p>
<p><img class="aligncenter size-full wp-image-24" title="kiwi1-3" src="http://www.blog.dervalp.com/wp-content/uploads/2009/05/kiwi1-3.jpg" alt="kiwi1-3" width="475" height="321" /></p>
<h2>4.       The Service project and the data project</h2>
<p>I know what I am going to do is not the best way but I feel comfortable with that.</p>
<p>I add a new class library called Kiwi.MVC.Data to receive my model and another called Kiwi.MVC.Services who will receive my services.</p>
<p>I clean a bit and here is the result:</p>
<p><img class="aligncenter size-full wp-image-25" title="kiwi1-4" src="http://www.blog.dervalp.com/wp-content/uploads/2009/05/kiwi1-4.jpg" alt="kiwi1-4" width="237" height="163" /></p>
<p>Before saving the solution, I would like to set up the behavior of VS. I want that VS stratup the project I am currently working on and not Kiwi.MVC.Web as it is by default. To do that, right click on your solution, properties and you receive that screen:</p>
<p><img class="aligncenter size-full wp-image-26" title="kiwi1-5" src="http://www.blog.dervalp.com/wp-content/uploads/2009/05/kiwi1-5.jpg" alt="kiwi1-5" width="628" height="386" /></p>
<p>In the Startup Project, use Current selection in place of Single startup project.</p>
<p>I try to build the solution and if it builds successfully, I have now an empty project ready to go&#8230;</p>
<p>You can find the source of the empty project in Codeplex : here <a href="http://dervalp.codeplex.com/">http://dervalp.codeplex.com</a></p>
<p>I am waiting for your feedback&#8230;</p>
<h2>5.      My opinion about MVC:</h2>
<p><em>&#8220;I have never like the webforms style of ASP.NET and this MVC framework is like a breath of fresh air for me. I used MVC pattern with Cakephp and I am very exited to discover all the possibilities of the ASP.NET MVC framework. I guess Microsoft is taking the right way to build powerfull web application while complying best practises.&#8221;</em></p>
<p><em></p>
<p></em></p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a title="Click me to see the sites." href="#" onclick="$$('div.d7').each( function(e) { e.visualEffect('slide_down',{duration:2.5}) }); return false;"><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d7" style="overflow:hidden">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://blog.dervalp.com/2009/05/08/kiwi-mvc-building-the-application-part1/&amp;title=Kiwi+MVC.NET+%3A+Building+the+application+Part1" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://blog.dervalp.com/2009/05/08/kiwi-mvc-building-the-application-part1/&amp;title=Kiwi+MVC.NET+%3A+Building+the+application+Part1" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://blog.dervalp.com/2009/05/08/kiwi-mvc-building-the-application-part1/" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://blog.dervalp.com/2009/05/08/kiwi-mvc-building-the-application-part1/&amp;title=Kiwi+MVC.NET+%3A+Building+the+application+Part1" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://blog.dervalp.com/2009/05/08/kiwi-mvc-building-the-application-part1/&amp;title=Kiwi+MVC.NET+%3A+Building+the+application+Part1" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://blog.dervalp.com/2009/05/08/kiwi-mvc-building-the-application-part1/&amp;title=Kiwi+MVC.NET+%3A+Building+the+application+Part1" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+Kiwi+MVC.NET+%3A+Building+the+application+Part1+@+http://blog.dervalp.com/2009/05/08/kiwi-mvc-building-the-application-part1/" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http://blog.dervalp.com/2009/05/08/kiwi-mvc-building-the-application-part1/&amp;t=Kiwi+MVC.NET+%3A+Building+the+application+Part1" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
<a style="font-size:90%;text-align: right; " title="Click me to hide the sites." href="#" onclick="$$('div.d7').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); return false;">Hide Sites</a>
</div>
</div>
<!-- Social Bookmarks END -->
<script type="text/javascript">$$('div.d7').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); </script>]]></content:encoded>
			<wfw:commentRss>http://blog.dervalp.com/2009/05/08/kiwi-mvc-building-the-application-part1/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
