<?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>Learning in Public</title>
	<atom:link href="http://learninginpublic.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://learninginpublic.net</link>
	<description>A collaborative learning site</description>
	<lastBuildDate>Thu, 10 Dec 2009 10:32:26 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Off-topic: Experiencing Orchard</title>
		<link>http://learninginpublic.net/off-topic-experiencing-orchard/</link>
		<comments>http://learninginpublic.net/off-topic-experiencing-orchard/#comments</comments>
		<pubDate>Thu, 10 Dec 2009 10:32:26 +0000</pubDate>
		<dc:creator>tobint</dc:creator>
				<category><![CDATA[Rabbit Trail]]></category>
		<category><![CDATA[ASP.NET MVC]]></category>
		<category><![CDATA[Controllers]]></category>
		<category><![CDATA[Models]]></category>
		<category><![CDATA[orchard]]></category>

		<guid isPermaLink="false">http://learninginpublic.net/?p=78</guid>
		<description><![CDATA[Yesterday, an announcement was posted that the Orchard Project is now part of the CodePlex Foundation(somehow we&#8217;re not supposed to confuse this with Microsoft&#8217;s CodePlex.com). Orchard is, as the site describes:
&#8230;a free, open source, community-focused project aimed at delivering applications and reusable components on the ASP.NET platform.
Orchard has been on my radar for a bit. I&#8217;ve [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Flearninginpublic.net%2Foff-topic-experiencing-orchard%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Flearninginpublic.net%2Foff-topic-experiencing-orchard%2F" height="61" width="51" /></a></div><p>Yesterday, an announcement was posted that the <a title="Orchard Project" href="http://www.orchardproject.net/" target="_blank">Orchard Project</a> is now part of the <a title="CodePlex Foundation" href="http://codeplex.org/" target="_blank">CodePlex Foundation</a>(somehow we&#8217;re not supposed to confuse this with Microsoft&#8217;s CodePlex.com). Orchard is, as the site describes:</p>
<blockquote><p>&#8230;a free, open source, community-focused project aimed at delivering applications and reusable components on the ASP.NET platform.</p></blockquote>
<p>Orchard has been on my radar for a bit. I&#8217;ve known Erik Porter for many years now (before either of us came to Microsoft). I&#8217;ve watched him work on Oxite (which my current un-updated &#8216;blog&#8217; is running on now) and even created a skin for that platform. When Erik moved over to start working on Orchard, I took notice. That said, I have been very interested in where this is heading in a very competitive market.</p>
<p>The thing that makes Orchard interesting, however, is that it isn&#8217;t meant to compete with other CM systems in the market today. Sure, Orchard will have a reference implementation of a CMS system, but the main interesting thing Orchard brings to the table is an extensible architecture that lets you improve an existing CMS or build a new one from scratch. I could wax poetic and try to define the system myself, but that would be wrong. I&#8217;m not on the team, and I don&#8217;t know everything there is to know. To be honest, I don&#8217;t even know if the Orchard team knows what is in store for them.</p>
<p>My interest brought me to download the code and start looking at it in depth. Once the MVC series is complete, I fully intend to go back and do some Orchard videos too &#8212; hopefully the APIs will be a bit more baked for that effort to make sense.</p>
<p>Still, I thought I would blog about it now as it seems very interesting to me. If you are interested in checking it out for yourself, I encourage you to follow the instructions for titled &#8220;How to Get Involved&#8221; on the <a title="Orchard project on Codeplex.com" href="http://orchard.codeplex.com" target="_blank">CodePlex project</a> page, then read ahead.</p>
<h2>Inspecting the Code</h2>
<p>The first thing I wanted to do was see how Orchard starts. The profound answer people always give when you ask where to start is, &#8220;Start from the beginning, of course.&#8221; Looking at the source code in Visual Studio, the beginning isn&#8217;t explicitly noted:</p>
<div class="wp-caption alignnone" style="width: 302px"><a href="http://farm3.static.flickr.com/2488/4173987390_2a5ace8a65.jpg"><img title="Orchard Project" src="http://farm3.static.flickr.com/2488/4173987390_2a5ace8a65.jpg" alt="Orchard Project" width="292" height="433" /></a><p class="wp-caption-text">Orchard Project</p></div>
<p>Luckily, I happen to know where the beginning of most ASP.NET -based applications is: in the <em>Application_Start()</em> method of the <a title="global.asax for Orchard Project" href="http://orchard.codeplex.com/SourceControl/changeset/view/43668#473927" target="_blank">global.asax.cs</a> file.</p>
<p><pre class="brush: csharp; light: true;">
protected void Application_Start() {
            RegisterRoutes(RouteTable.Routes);
            _host = OrchardStarter.CreateHost(MvcSingletons);
            _host.Initialize();
            // ...
}
</pre></p>
<h2>Discovering Dependencies</h2>
<p>The first thing that happens when we look at the <em>Application_Start</em> method in <em>global.asax.cs</em> is that the application registers routes that will be used. We&#8217;ll dig into how this works in our next <a title="ASP.NET MVC Video Series" href="http://learninginpublic.net/category/learning-plans/asp-net-mvc/" target="_blank">ASP.NET MVC video</a>discussion. Orchard&#8217;s unique works right after that. We see that Orchard get&#8217;s a reference to an <a title="IOrchardHost" href="http://orchard.codeplex.com/SourceControl/changeset/view/43668#473655">IOrchardHost</a> interface through a static method named <em>CreateHost()</em>. Obviously that interface has to point to something concrete, so I dug into <em>CreateHost</em> to see what it does. Of course this method was very lightweight and called a private method named <em>CreateHostContainer</em> which in turn returned an <em>Autofac.IContainer</em> interface.</p>
<p>This is our first interesting dependency that Orchard is taking &#8212; strangely enough that dependency is on something called an &#8220;<a title="IoC" href="http://en.wikipedia.org/wiki/Inversion_of_control" target="_blank">Inversion of Control</a>&#8221; (IoC) container. Once again, we&#8217;ll cover IoC in our ASP.NET MVC series. For now, just understand that Orchard is using an IoC container called <a title="Autofac" href="http://code.google.com/p/autofac/" target="_blank">Autofac</a>to resolve interfaces to concrete classes. The benefit of this is that we can &#8220;inject&#8221; functionality into Orchard using Autofac. Orchard doesn&#8217;t need to know how we implement interfaces &#8212; just how we are interacting with them. We can even &#8220;inject&#8221; dependent assemblies into Orchard in order to use the concrete classes our interfaces represent. If this is confusing, just move on for now.  I&#8217;m using Orchard as an excuse to introduce you to concepts we will cover in our video series!</p>
<h2>Inspecting the Blog Controller</h2>
<p>Now we have a little information about some of the underpinnings of Orchard. Let&#8217;s take what we know already about controllers in an MVC application to work while we investigate further. I can see just from running the application that the BlogController  is one that has been worked on a bit. If we scroll back up in the project and look under the &#8220;<em>packages</em>&#8221; solution folder, we should see the &#8220;<em>Orchard.Blogs</em>&#8221; project. This project is an MVC application in and of itself. It has models, views, and controllers. I decided to dive into the <a title="BlogController.cs" href="http://orchard.codeplex.com/SourceControl/changeset/view/43668#531173" target="_blank">BlogController.cs</a> file. You should already be familiar with the basics of controllers if you have done the first three videos on this site. You&#8217;ll see several methods return <em>ActionResult</em> class instances rather than the <em>ViewResult</em> which we&#8217;ve been using so far. Don&#8217;t let that bother you either. Once again, we&#8217;ll get into that in another post!</p>
<p>Looking at the constructor for this controller, I see that Autofac is &#8220;injecting&#8221; a dependency on whatever is registered to return an <a title="ISessionLocator" href="http://orchard.codeplex.com/SourceControl/changeset/view/43668#473647" target="_blank">ISessionLocator</a>reference. Naturally I want to see what is registered for ISessionLocator. I did a search in the solution for the interface name and came across the only method in <a title="DataModule" href="http://orchard.codeplex.com/SourceControl/changeset/view/43668#473644" target="_blank">DataModule.cs</a> called &#8220;<em>Load()</em>&#8220;.</p>
<p><pre class="brush: csharp; light: true;">
protected override void Load(ContainerBuilder builder) {
            builder.RegisterGeneric(typeof (Repository&lt;&gt;)).As(typeof (IRepository&lt;&gt;)).FactoryScoped();
            builder.Register&lt;HackSessionLocator&gt;().As&lt;ISessionLocator&gt;().ContainerScoped();
}
</pre></p>
<p>This method registers the &#8220;<a title="HackSessionLocator" href="http://orchard.codeplex.com/SourceControl/changeset/view/43668#473645" target="_blank">HackSessionLocator</a>&#8221; class as the concrete implementation for <em>ISessionLocator</em>. This is where we start finding more of the plumbing dependencies that Orchard is taking.</p>
<h2>HackSessionLocator</h2>
<p>As the name HackSessionLocator indicates, this is likely just something thrown together to get plumbing working so the team can work on the rest of the project. It appears from this that the team decided to use a number of hard-coded dependencies to get the project moving. I can imagine that a real session locator will not be so, well, hackish. The great thing about using dependency injection via the Autofac IoC container is that all they need to do is write a new session locator class, then register the new locator instead of HackSessionLocator. For now, I wanted to take note of a few other decisions the teams seems to have made in the short term.</p>
<p>If you notice the namespaces that the HackSessionLocator uses, you&#8217;ll find references to <strong>NHibernate</strong> and <strong>FluentNHibernate</strong>. If you aren&#8217;t familiar with these namespaces, <a title="NHibernate" href="http://sourceforge.net/projects/nhibernate/" target="_blank">NHibernate</a>is a .NET object-relational mapper (ORM) &#8211; again, another major future topic of our MVC series. An ORM framework like NHibernate maps data in a relational database to .NET types that can be easily consumed by your application. The best part is that your application doesn&#8217;t need to know what database you are mapping to. The framework does all the magic of mapping data from a repository to a model, and allows you to execute typical CRUD (Create, Read, Update, Delete) methods on that data &#8211; again without knowledge of how that functionality is implemented by the repository under the hood. <a title="FluentNHibernate" href="http://fluentnhibernate.org/" target="_blank">FluentNHibernate</a>is simply another layer that allows you to configure NHibernate without XML files.</p>
<h2>Wrapping Up and Next Steps</h2>
<p>This was just a sneak look at Orchard. We haven&#8217;t even gotten into the details yet. There is a lot more goodness happening in here. We&#8217;ve seen how Orchard is separating concerns very well using tools like Autofac and NHibernate. At some point, we&#8217;ll dig in deeper, but until Orchard is close to a first release, I hesitate to go too much further. I&#8217;m personally going to create my own content types and try doing some dev work in these early stages so I can give the team feedback. I hope that you will too as you feel comfortable.</p>
]]></content:encoded>
			<wfw:commentRss>http://learninginpublic.net/off-topic-experiencing-orchard/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>ASP.NET MVC &#8211; Lesson 3</title>
		<link>http://learninginpublic.net/asp-net-mvc-lesson-3/</link>
		<comments>http://learninginpublic.net/asp-net-mvc-lesson-3/#comments</comments>
		<pubDate>Sun, 06 Dec 2009 10:10:42 +0000</pubDate>
		<dc:creator>tobint</dc:creator>
				<category><![CDATA[ASP.NET MVC]]></category>
		<category><![CDATA[Models]]></category>
		<category><![CDATA[validation]]></category>

		<guid isPermaLink="false">http://learninginpublic.net/?p=66</guid>
		<description><![CDATA[Play Video
Summary:
This lesson discusses the basics of what I&#8217;m learning about the role of models in the ASP.NET MVC framework. We show how models are used to persist data between views, how to make MVC automatically binds posted data to a model, and how to validate data with your model.
Resources:
Pro ASP.NET MVC Framework
Disclosure:
I do not [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Flearninginpublic.net%2Fasp-net-mvc-lesson-3%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Flearninginpublic.net%2Fasp-net-mvc-lesson-3%2F" height="61" width="51" /></a></div><p><a href="http://learninginpublic.net/asp-net-mvc-lesson-3/#mediaPlayer_66_0">Play Video</a></p>
<p><strong>Summary:</strong><br />
This lesson discusses the basics of what I&#8217;m learning about the role of models in the ASP.NET MVC framework. We show how models are used to persist data between views, how to make MVC automatically binds posted data to a model, and how to validate data with your model.</p>
<p><strong>Resources:</strong><br />
<a href="http://www.amazon.com/gp/product/1430210079?ie=UTF8&#038;tag=huntingtonfor-20&#038;linkCode=as2&#038;camp=1789&#038;creative=390957&#038;creativeASIN=1430210079">Pro ASP.NET MVC Framework</a><img src="http://www.assoc-amazon.com/e/ir?t=huntingtonfor-20&#038;l=as2&#038;o=1&#038;a=1430210079" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /></p>
<p><strong>Disclosure:</strong><br />
I do not know Steven Sanderson nor do I have any outstanding obligations to Apress (I did co-authored one book with them many years ago). I have added a referral code to the link on Amazon books. Despite my ability to grab a small fee if you use my link to buy the book, I would still recommend it.</p>
]]></content:encoded>
			<wfw:commentRss>http://learninginpublic.net/asp-net-mvc-lesson-3/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
<enclosure url="http://learninginpublic.net/wp-content/uploads/2009/12/06/Learning%20in%20Public%20-%20ASP.NET%20MVC%20Lesson%203.wmv" length="39414107" type="video/x-ms-wmv" />
		</item>
		<item>
		<title>ASP.NET MVC &#8211; Lesson 2</title>
		<link>http://learninginpublic.net/asp-net-mvc-lesson-2/</link>
		<comments>http://learninginpublic.net/asp-net-mvc-lesson-2/#comments</comments>
		<pubDate>Fri, 04 Dec 2009 10:09:07 +0000</pubDate>
		<dc:creator>tobint</dc:creator>
				<category><![CDATA[ASP.NET MVC]]></category>
		<category><![CDATA[Controllers]]></category>

		<guid isPermaLink="false">http://learninginpublic.net/?p=42</guid>
		<description><![CDATA[This lesson clarifies the distinct responsibilities of the controller. I demonstrate how the controller can work without a view or any models and then go on to explain the roll of views a bit more tightly.
]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Flearninginpublic.net%2Fasp-net-mvc-lesson-2%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Flearninginpublic.net%2Fasp-net-mvc-lesson-2%2F" height="61" width="51" /></a></div><p><a href="http://learninginpublic.net/asp-net-mvc-lesson-2/#mediaPlayer_42_0">Play Video</a></p>
<p><strong>Summary:</strong><br />
This lesson clarifies the distinct responsibilities of the controller. I demonstrate how the controller can work without a view or any models and then go on to explain the roll of views a bit more tightly.</p>
<p><strong>Resources:</strong><br />
<a href="http://www.amazon.com/gp/product/1430210079?ie=UTF8&#038;tag=huntingtonfor-20&#038;linkCode=as2&#038;camp=1789&#038;creative=390957&#038;creativeASIN=1430210079">Pro ASP.NET MVC Framework</a><img src="http://www.assoc-amazon.com/e/ir?t=huntingtonfor-20&#038;l=as2&#038;o=1&#038;a=1430210079" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /></p>
<p><strong>Disclosure:</strong></p>
<p>I do not know Steven Sanderson nor do I have any outstanding obligations to Apress (I did co-authored one book with them many years ago). I have added a referral code to the link on Amazon books. Despite my ability to grab a small fee if you use my link to buy the book, I would still recommend it.</p>
]]></content:encoded>
			<wfw:commentRss>http://learninginpublic.net/asp-net-mvc-lesson-2/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
<enclosure url="http://learninginpublic.net/wp-content/uploads/2009/12/04/Learning%20in%20Public%20-%20ASP.NET%20MVC%20Lesson%202.wmv" length="25786015" type="video/x-ms-wmv" />
		</item>
		<item>
		<title>ASP.NET MVC &#8211; Lesson 1</title>
		<link>http://learninginpublic.net/asp-net-mvc-lesson-1/</link>
		<comments>http://learninginpublic.net/asp-net-mvc-lesson-1/#comments</comments>
		<pubDate>Fri, 20 Nov 2009 16:09:04 +0000</pubDate>
		<dc:creator>tobint</dc:creator>
				<category><![CDATA[ASP.NET MVC]]></category>
		<category><![CDATA[Controllers]]></category>
		<category><![CDATA[Models]]></category>
		<category><![CDATA[Views]]></category>

		<guid isPermaLink="false">http://learninginpublic.net/?p=27</guid>
		<description><![CDATA[Play Video
Summary:
I discuss some history behind ASP.NET and the need to move to ASP.NET.  I demonstrate the ability to execute actions in a control with and without a view. I then demonstrate how to use different views of the same data returned by the controller.
Resources:
Pro ASP.NET MVC Framework
Disclosure:
I do not know Steven Sanderson nor do [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Flearninginpublic.net%2Fasp-net-mvc-lesson-1%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Flearninginpublic.net%2Fasp-net-mvc-lesson-1%2F" height="61" width="51" /></a></div><p><a href="http://learninginpublic.net/asp-net-mvc-lesson-1/#mediaPlayer_27_0">Play Video</a></p>
<p><strong>Summary:</strong><br />
I discuss some history behind ASP.NET and the need to move to ASP.NET.  I demonstrate the ability to execute actions in a control with and without a view. I then demonstrate how to use different views of the same data returned by the controller.</p>
<p><strong>Resources:</strong><br />
<a href="http://www.amazon.com/gp/product/1430210079?ie=UTF8&#038;tag=huntingtonfor-20&#038;linkCode=as2&#038;camp=1789&#038;creative=390957&#038;creativeASIN=1430210079">Pro ASP.NET MVC Framework</a><img src="http://www.assoc-amazon.com/e/ir?t=huntingtonfor-20&#038;l=as2&#038;o=1&#038;a=1430210079" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /></p>
<p><strong>Disclosure:</strong></p>
<p>I do not know Steven Sanderson nor do I have any outstanding obligations to Apress (I did co-authored one book with them many years ago). I have added a referral code to the link on Amazon books. Despite my ability to grab a small fee if you use my link to buy the book, I would still recommend it.</p>
]]></content:encoded>
			<wfw:commentRss>http://learninginpublic.net/asp-net-mvc-lesson-1/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
<enclosure url="http://learninginpublic.net/wp-content/uploads/2009/11/20/Learning%20in%20Public%20-%20ASP.NET%20MVC%20Lesson%201.mp4" length="61195604" type="video/mp4" />
		</item>
		<item>
		<title>Introduction to Learning in Public</title>
		<link>http://learninginpublic.net/introduction-to-learning-in-public/</link>
		<comments>http://learninginpublic.net/introduction-to-learning-in-public/#comments</comments>
		<pubDate>Thu, 19 Nov 2009 18:30:26 +0000</pubDate>
		<dc:creator>tobint</dc:creator>
				<category><![CDATA[About]]></category>

		<guid isPermaLink="false">http://learninginpublic.net/?p=20</guid>
		<description><![CDATA[Play Video
Summary:
I&#8217;ve recently decided to focus my skill acquisition back toward a broader set of technologies. I&#8217;m including the public in on my learning process in the hopes that collaboration will help us all learn from my mistakes.
Resources:

Alan Stevens: Coding in Public
Wikipedia: Drefus model of skill acquisition

]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Flearninginpublic.net%2Fintroduction-to-learning-in-public%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Flearninginpublic.net%2Fintroduction-to-learning-in-public%2F" height="61" width="51" /></a></div><p><a href="http://learninginpublic.net/introduction-to-learning-in-public/#mediaPlayer_20_0">Play Video</a></p>
<p><strong>Summary:<br />
</strong>I&#8217;ve recently decided to focus my skill acquisition back toward a broader set of technologies. I&#8217;m including the public in on my learning process in the hopes that collaboration will help us all learn from my mistakes.</p>
<p><strong>Resources:</strong></p>
<ul>
<li><a href="http://vimeo.com/3898804" target="_blank">Alan Stevens: Coding in Public</a></li>
<li><a href="http://en.wikipedia.org/wiki/Dreyfus_model_of_skill_acquisition">Wikipedia: Drefus model of skill acquisition</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://learninginpublic.net/introduction-to-learning-in-public/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
<enclosure url="http://learninginpublic.net/wp-content/uploads/2009/11/19/learning%20in%20public.mp4" length="6676534" type="video/mp4" />
		</item>
	</channel>
</rss>
