<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8879753012890807179</id><updated>2026-01-06T02:16:37.495-08:00</updated><category term="Process"/><category term="SharePoint"/><category term="Silverlight"/><category term="ASP.NET MVC"/><category term="Architecture"/><category term="Azure"/><category term="development"/><category term="learning"/><category term="Autofac"/><category term="CMS"/><category term="Dependency Injection"/><category term="Drag and Drop"/><category term="Facebook"/><category term="Google Wave"/><category term="IoC"/><category term="Kindle"/><category term="MVP"/><category term="Media"/><category term="Social"/><category term="Twitter"/><category term="Video"/><category term="WP7"/><category term="change"/><category term="jQuery"/><category term="leadership"/><title type='text'>2010Wave</title><subtitle type='html'>Total immersion in the 2010 development wave</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://2010wave.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8879753012890807179/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://2010wave.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Darren Neimke</name><uri>http://www.blogger.com/profile/04138573191558270297</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://markitup.com/images/MyPicture_Small.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>24</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8879753012890807179.post-2194345739402517636</id><published>2010-06-26T18:35:00.000-07:00</published><updated>2010-06-26T18:38:09.600-07:00</updated><title type='text'>Search Engines vs. Decision Engines</title><content type='html'>Bing seems to have branded itself as something it calls a &quot;decision engine&quot; - whatever the heck that means. &amp;nbsp;I just did a search for &quot;decision engine&quot; (using my search engine) and &lt;a href=&quot;http://en.wikipedia.org/wiki/Decision_engine&quot;&gt;the entry that came up&lt;/a&gt; told me that a decision engine is Bing! &amp;nbsp;So it seems to be a circular reference.&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;On Bing... I get pretty dismayed by the promotional team who &lt;a href=&quot;http://www.bing.com/community/blogs/search/archive/2010/06/25/the-news-about-bing-news.aspx&quot;&gt;mock up screens&lt;/a&gt; in the vain hope that they will lead us to believe that their &quot;decision engine&quot; is something more useful than it really is. &amp;nbsp;They artshop these elaborate landing pages which, on the face of it would lead to the early demise of search engines, wikipedia, and digital news services.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Alas, all it not as it seems. &amp;nbsp;The proof is always in the tasting (as they say), and so here we are, right in the midst of Soccer World Cup mania. &amp;nbsp;Everyone is talking about it. &amp;nbsp;The US are better positioned than they ever have been. &amp;nbsp;So let&#39;s do a Google vs. Bing bake-off and see what we get: &lt;br /&gt;
&lt;br /&gt;
Here is Google (search engine):&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnLCT55kaWXmT7jwORPeDdU3bjKEjDXPHtKS2l38EBvmjQQMuGbUruUFbZs6FBkSxZWm0Kw6BoEKlwZVJ7g4gUjQjYLQkHJyn5amMx_9-tpe6lymH_bNIAasxTYHHOf7CjfOOLiYpGyq0X/s1600/GoogleSoccerSearch.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;219&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnLCT55kaWXmT7jwORPeDdU3bjKEjDXPHtKS2l38EBvmjQQMuGbUruUFbZs6FBkSxZWm0Kw6BoEKlwZVJ7g4gUjQjYLQkHJyn5amMx_9-tpe6lymH_bNIAasxTYHHOf7CjfOOLiYpGyq0X/s320/GoogleSoccerSearch.PNG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Here is Bing (decision engine):&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhSLYndz1Pas-SqllhvnV7LMCHoIdtXgxK7587aCmuh_23ZhA0woqAsOl8Ez3WKnErJN74b6YwZVfMWOIkF0-yCBFPNJCI25h3jBMsAarcVo9ZRg_8qTmkc1kwwVsE3vodJUUTlj6Hiuyt/s1600/BingSoccerSearch.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;231&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhSLYndz1Pas-SqllhvnV7LMCHoIdtXgxK7587aCmuh_23ZhA0woqAsOl8Ez3WKnErJN74b6YwZVfMWOIkF0-yCBFPNJCI25h3jBMsAarcVo9ZRg_8qTmkc1kwwVsE3vodJUUTlj6Hiuyt/s320/BingSoccerSearch.PNG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Decision made! :-)&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://2010wave.blogspot.com/feeds/2194345739402517636/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://2010wave.blogspot.com/2010/06/search-engines-vs-decision-engines.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8879753012890807179/posts/default/2194345739402517636'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8879753012890807179/posts/default/2194345739402517636'/><link rel='alternate' type='text/html' href='http://2010wave.blogspot.com/2010/06/search-engines-vs-decision-engines.html' title='Search Engines vs. Decision Engines'/><author><name>Darren Neimke</name><uri>http://www.blogger.com/profile/04138573191558270297</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://markitup.com/images/MyPicture_Small.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnLCT55kaWXmT7jwORPeDdU3bjKEjDXPHtKS2l38EBvmjQQMuGbUruUFbZs6FBkSxZWm0Kw6BoEKlwZVJ7g4gUjQjYLQkHJyn5amMx_9-tpe6lymH_bNIAasxTYHHOf7CjfOOLiYpGyq0X/s72-c/GoogleSoccerSearch.PNG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8879753012890807179.post-3400975304207627816</id><published>2010-06-01T22:28:00.000-07:00</published><updated>2010-06-02T21:07:34.252-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET MVC"/><title type='text'>ASP.NET MVC Data Validation</title><content type='html'>I&#39;ve started to create a set of guidance for developers to show how to implement common validation concerns in business applications. &amp;nbsp;To that end I have created a sample project and an accompanying Guidance document to demonstrate these practices. &amp;nbsp;You can view a copy of these here:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;http://shc.org.au/files/2010Wave/ValidationExamples.zip&quot;&gt;Sample MVC Project&lt;/a&gt; - 317KB&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://shc.org.au/files/2010Wave/Validation%20Whitepaper.pdf&quot;&gt;Guidance Documentation (PDF)&lt;/a&gt; - 682KB&lt;/li&gt;
&lt;/ul&gt;What I would like next is to gather more complex scenarios and implement them. &amp;nbsp;If you have any requests for scenarios that you would like to see implemented, please leave a comment and I will look at adding it in.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Updates&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
3rd June - Updated to include a new recipe for validating against values bound to dropdown lists</content><link rel='replies' type='application/atom+xml' href='http://2010wave.blogspot.com/feeds/3400975304207627816/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://2010wave.blogspot.com/2010/06/aspnet-mvc-data-validation.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8879753012890807179/posts/default/3400975304207627816'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8879753012890807179/posts/default/3400975304207627816'/><link rel='alternate' type='text/html' href='http://2010wave.blogspot.com/2010/06/aspnet-mvc-data-validation.html' title='ASP.NET MVC Data Validation'/><author><name>Darren Neimke</name><uri>http://www.blogger.com/profile/04138573191558270297</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://markitup.com/images/MyPicture_Small.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8879753012890807179.post-406988240323979301</id><published>2010-04-28T20:55:00.000-07:00</published><updated>2010-04-28T23:08:11.801-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="change"/><category scheme="http://www.blogger.com/atom/ns#" term="Process"/><title type='text'>Change</title><content type='html'>&lt;iframe align=&quot;left&quot; frameborder=&quot;0&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; scrolling=&quot;no&quot; src=&quot;http://rcm.amazon.com/e/cm?t=forestlakewebser&amp;amp;o=1&amp;amp;p=8&amp;amp;l=bpl&amp;amp;asins=0875847471&amp;amp;fc1=000000&amp;amp;IS2=1&amp;amp;lt1=_blank&amp;amp;m=amazon&amp;amp;lc1=0000FF&amp;amp;bc1=000000&amp;amp;bg1=FFFFFF&amp;amp;f=ifr&quot; style=&quot;align: left; height: 245px; padding-right: 10px; padding-top: 5px; width: 131px;&quot;&gt;&lt;/iframe&gt;Change is the process of moving from a current state to a new, improved state. &amp;nbsp;The business world is full of programs that are designed to manage this transition. &amp;nbsp;An alarmingly high percentage of these programs (some say as high as 80%) are claimed to have failed to have achieved what they were designed to do. &lt;br /&gt;
&lt;br /&gt;
In my experience of actual people using actual technology to carry out actual business processes, this is not really surprising. &amp;nbsp;In fact, I would suggest in reality, we should be aspiring to acheive a 100% failure rate if change is the thing that we really are aiming for. &amp;nbsp;Of course in MBA courses, they could never draw it this way as total failure would not fit into 4 quadrants or a concentric circles diagram.&lt;br /&gt;
&lt;br /&gt;
I contend that, in order to know that you need change, you must know that the place you are currently in is not as good as you would envisage. &amp;nbsp;In fact, I would suggest that for all of the places that I&#39;ve seen, the current actual state is probably deemed (by those who are bound within in it) to be somewhat closer to a scene from Dante&#39;s Inferno - in fact, you might as well have these words engraved on plates above the front doors:&lt;br /&gt;
&lt;blockquote&gt;&amp;nbsp;&quot;Lasciate ogne speranza, voi ch&#39;intrate&quot; (Abandon all hope, ye who enter here)&lt;/blockquote&gt;At this point it is generally decided that change is requiredd and so the business will create a vision to explain where we need to head and how everybody will feel when we get there. &amp;nbsp;They then &quot;sell&quot; this new vision to the people and this helps to create the feeling of optimism and hope that are required in order to bring about action to enact the change.&lt;br /&gt;
&lt;br /&gt;
Finally - and this is the important part in my story - a formal program is created within the enterprise which is designed to enact the changes that have been agreed upon. &amp;nbsp;Even better, you might appoint a person to be involved in the change program and annoint them as an &quot;agent of change&quot;.&lt;br /&gt;
&lt;br /&gt;
The reason that these agents of change (programs and people) are important at this point is that we now have a physical vehicle to attach blame to for when things are deemed to be bad. &amp;nbsp;And I&#39;m not necessarily saying this in a bad way, but think about the alternative. &amp;nbsp;Let me give an example:&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;People complain about using network shares to collaborate citing that they cannot find things and the organization of information is poor&lt;/li&gt;
&lt;li&gt;A change program is created to improve the situation&lt;/li&gt;
&lt;li&gt;A modern technology is acquired and installed and training given to the users on how to use it&lt;/li&gt;
&lt;li&gt;People complain about using the new technology to collaborate citing that they cannot find things and the organization of information is poor&lt;/li&gt;
&lt;/ol&gt;&lt;br /&gt;
I can substitute the example with pretty much major change movement that I&#39;ve experienced and the results are pretty similar - even though you may initially get some good results, the final result will mostly arrive at the same point to which I have observed in the example above.&lt;br /&gt;
&lt;br /&gt;
So if this was the best that it gets, business would be screwed, there could be no room for optimism and everybody would feel like a failure. &amp;nbsp;But having an agent to point towards or to apportion blame against, provides us with the hope that things will become better. &amp;nbsp;In the example above, you may find people citing that&amp;nbsp;things are worse than they were before because:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;The technology was a poor choice&lt;/li&gt;
&lt;li&gt;The change agent was a poor deliverer&lt;/li&gt;
&lt;li&gt;The benefit that would fix a particular problem or concern was planned for a &quot;phase 2&quot; implementation&lt;/li&gt;
&lt;li&gt;The business has not given us sufficient training or direction&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
Being able to purge these things from our system actually gives impetus to a new round of change and so the circle continues.&lt;br /&gt;
&lt;br /&gt;
So we change, and we change, and we change again. &amp;nbsp;Even failed change is better than stasis as it creates activity which motivates people. &amp;nbsp;And a complete lack of change would lead ultimately to death.</content><link rel='replies' type='application/atom+xml' href='http://2010wave.blogspot.com/feeds/406988240323979301/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://2010wave.blogspot.com/2010/04/change.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8879753012890807179/posts/default/406988240323979301'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8879753012890807179/posts/default/406988240323979301'/><link rel='alternate' type='text/html' href='http://2010wave.blogspot.com/2010/04/change.html' title='Change'/><author><name>Darren Neimke</name><uri>http://www.blogger.com/profile/04138573191558270297</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://markitup.com/images/MyPicture_Small.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8879753012890807179.post-1719392623925045898</id><published>2010-03-17T15:48:00.000-07:00</published><updated>2010-03-19T22:43:39.761-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="learning"/><category scheme="http://www.blogger.com/atom/ns#" term="Silverlight"/><category scheme="http://www.blogger.com/atom/ns#" term="WP7"/><title type='text'>Silverlight and WP7 Learning Resources</title><content type='html'>&lt;div class=&quot;MsoNormal&quot;&gt;Whilst trying to get my head around Silverlight a bit better (it is one of the 2 programming models for Windows Phone) I came across some useful new learning resources:   &lt;br /&gt;    &lt;br /&gt;    &lt;ul&gt;     &lt;li&gt;&lt;a href=&quot;http://channel9.msdn.com/learn/courses/Silverlight4/&quot;&gt;Channel 9 Silverlight Training Course&lt;/a&gt;&amp;#160;&lt;/li&gt;      &lt;li&gt;&lt;a href=&quot;http://www.microsoft.com/design/toolbox/&quot;&gt;Microsoft Design Toolbox&lt;/a&gt;&amp;#160;&lt;/li&gt;   &lt;/ul&gt;   &lt;a href=&quot;http://channel9.msdn.com/learn/courses/Silverlight4/&quot;&gt;&lt;/a&gt;&lt;/div&gt; And if you want to get started with Windows Phone development, the best resources are:  &lt;br /&gt;  &lt;div class=&quot;MsoNormal&quot;&gt;   &lt;br /&gt;&lt;/div&gt;  &lt;div class=&quot;MsoNormal&quot;&gt;   &lt;ul&gt;     &lt;li&gt;Free e-book: &lt;a href=&quot;http://blogs.msdn.com/microsoft_press/archive/2010/03/15/free-ebook-programming-windows-phone-7-series-draft-preview.aspx&quot;&gt;Programming Windows Phone 7 Series&lt;/a&gt;&amp;#160;&lt;/li&gt;      &lt;li&gt;Developer Tools (includes VS2010 Express for WP7) - &lt;a href=&quot;http://developer.windowsphone.com/windows-phone-7-series/&quot;&gt;WP7 Developer Portal&lt;/a&gt;&lt;/li&gt;      &lt;li&gt;&lt;a href=&quot;http://adamkinney.wordpress.com/2010/03/19/install-checklist-for-silverlight-4-rc-blend-4-beta-and-windows-phone-developer-tools-from-mix10/&quot; target=&quot;_blank&quot;&gt;Install checklist for Silverlight 4 RC, Blend 4 Beta and Windows Phone Developer tools from MIX10&lt;/a&gt;&lt;/li&gt;   &lt;/ul&gt; &lt;/div&gt;  &lt;p&gt;There&#39;s also a good video of Mike Harsh going through &lt;a href=&quot;http://johnpapa.net/silverlight/silverlight-tv-14-developing-for-windows-phone-7-with-silverlight&quot;&gt;Developing for Windows Phone 7 with Silverlight&lt;/a&gt; and his &lt;a href=&quot;http://blogs.msdn.com/mharsh/archive/2010/03/17/slides-and-demos-from-my-mix10-session.aspx&quot;&gt;Slides and demos from his MIX10 Session&lt;/a&gt;.&lt;/p&gt; &lt;o:p&gt;&lt;/o:p&gt;  &lt;br /&gt;  &lt;div style=&quot;text-indent: -18pt; mso-list: l0 level1 lfo2&quot; class=&quot;MsoListParagraph&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;  </content><link rel='replies' type='application/atom+xml' href='http://2010wave.blogspot.com/feeds/1719392623925045898/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://2010wave.blogspot.com/2010/03/silverlight-and-wp7-learning-resources.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8879753012890807179/posts/default/1719392623925045898'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8879753012890807179/posts/default/1719392623925045898'/><link rel='alternate' type='text/html' href='http://2010wave.blogspot.com/2010/03/silverlight-and-wp7-learning-resources.html' title='Silverlight and WP7 Learning Resources'/><author><name>Darren Neimke</name><uri>http://www.blogger.com/profile/04138573191558270297</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://markitup.com/images/MyPicture_Small.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8879753012890807179.post-3901509050669887395</id><published>2010-03-03T16:18:00.000-08:00</published><updated>2010-03-03T16:27:07.055-08:00</updated><title type='text'>Getting Started with Graffiti CMS</title><content type='html'>Getting up and running with Graffiti is very easy and one of the things that I really enjoy about using it. One of the things that I&#39;ve struggled with when using some of the other larger open source products is just getting them going. For example, having to use SQL Server often means that I need to install it, then create the database (and pray that the scripts work) and then do configuration.&lt;br /&gt;
&lt;br /&gt;
Also, some Open Source products are heavily dependant on other open source software. This makes them brittle and tied to what often becomes other unsupported legacy code. This has the knock on effect of making the product harder to get started with as time goes by.&lt;br /&gt;
&lt;br /&gt;
Graffiti on the other hand is lightweight and relatively free of external bindings. This has meant that getting going with an Access database as the backend has not changed significantly in the 3 years that I&#39;ve been using the product.&lt;br /&gt;
&lt;br /&gt;
To get started, browse to the Graffiti CMS site on CodePlex and work through the &quot;Getting Started&quot; notes that appear on the home page. These lead you through the following steps:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Download the &lt;a href=&quot;http://graffiticms.codeplex.com/SourceControl/ListDownloadableCommits.aspx&quot; target=&quot;_blank&quot; x=&quot;y&quot;&gt;v1.3 source code&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Download &quot;extra&quot; assemblies from &lt;a href=&quot;http://graffiticms.com/lib/lib.zip&quot; target=&quot;_blank&quot; x=&quot;y&quot;&gt;http://graffiticms.com/lib/lib.zip&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Unzip and add the extra assemblies to the \Branches\v1.3\src\Lib folder&lt;/li&gt;
&lt;li&gt;Open the \Branches\v1.3\src\Graffiti.sln solution file with Visual Studio 2008&lt;/li&gt;
&lt;li&gt;Update web.config to use the desired database settings&lt;/li&gt;
&lt;li&gt;If you are not running IIS7 and &lt;a href=&quot;http://asp.net/&quot; target=&quot;_blank&quot; x=&quot;y&quot;&gt;ASP.NET&lt;/a&gt; 3.5 SP1, you should enable the &quot;Generate Folders...&quot; option in the admin &amp;gt;Site Options &amp;gt; Configuration page&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;b&gt;Extra Assemblies&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
The extra assemblies are:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Telligent.DynamicConfiguration&lt;/li&gt;
&lt;li&gt;Telligent.Glow - Web Controls by Telligent&lt;/li&gt;
&lt;li&gt;Telligent.Glow.Editor - Web Controls by Telligent&lt;/li&gt;
&lt;/ul&gt;These assemblies provide additional functionality and web controls and I believe that they are packaged separately because they needed to be subject to different licensing from the core Graffiti software.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Database settings&lt;/b&gt;&lt;br /&gt;
The notes for getting a database up and running for your Graffiti installation can be found . Essentially there are 3 parts to this:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Choose your Provider. &amp;nbsp;This is set via the &quot;DataBuddy::Provider&quot; key in web.config.&lt;/li&gt;
&lt;li&gt;Update your connection string in web.config. There are samples provided, so just copy the one that is relevant for your database provider.&lt;/li&gt;
&lt;li&gt;Set up your database as per the notes that can be found in the \Branches\v1.3\data\read_me.txt file.&lt;/li&gt;
&lt;/ul&gt;If you are using MS Access for your database then getting up and running is as simple as copying a template .mdb file into your App_Data folder and then running the solution. I like the Access database option as it makes the entire website self contained, making it easy to move around and deploy.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Generate Folders&lt;/b&gt;&lt;br /&gt;
After you have installed and configured your basic set up, you should read through the Getting Started Guide to gain an understanding of more advanced configuration options that you might need to consider. One of the major things that you need to be aware of is the difference between how the site runs under IIS7 and IIS6.&lt;br /&gt;
&lt;br /&gt;
Running under IIS7, the site uses an inbuilt routing mechanism for serving up virtual paths. When running under IIS6, the inbuilt routing is still used, however for that to work, the folders for paths need to physically exist on disk. To acheive this you need to log in to the Administration section and go to Site Options / Configuration and ensure that the &quot;Generate Folders for Posts/Categories&quot; option is checked.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Running the solution&lt;/b&gt;&lt;br /&gt;
From within Visual Studio, run the application. You can either click login or browse directly to /graffiti-admin/ and then login as an Administrator to start creating content and managing other aspects of the site. The initial Administrator username is &#39;Admin&#39; and the password can be found in the Graffiti:User:DefaultPassword key in web.config.</content><link rel='replies' type='application/atom+xml' href='http://2010wave.blogspot.com/feeds/3901509050669887395/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://2010wave.blogspot.com/2010/03/getting-started-with-graffiti-cms.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8879753012890807179/posts/default/3901509050669887395'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8879753012890807179/posts/default/3901509050669887395'/><link rel='alternate' type='text/html' href='http://2010wave.blogspot.com/2010/03/getting-started-with-graffiti-cms.html' title='Getting Started with Graffiti CMS'/><author><name>Darren Neimke</name><uri>http://www.blogger.com/profile/04138573191558270297</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://markitup.com/images/MyPicture_Small.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8879753012890807179.post-8727802058269112108</id><published>2010-03-03T09:17:00.001-08:00</published><updated>2010-03-03T09:18:37.377-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CMS"/><title type='text'>Learning how to use Graffiti CMS</title><content type='html'>&lt;p&gt;I&#39;ve been thinking about CMS for a while and recently decided to get back in to using Graffiti CMS as my CMS tool of choice. I&#39;ve used Graffiti before and I believe that, for a .NET developer, it is probably one of the best CMS tools around. &lt;/p&gt;  &lt;p&gt;Late last week I downloaded it and used it to bang out this simple little hockey club website - &lt;a href=&quot;http://web9ecf9dd.titan.studiocoast.com.au/&quot;&gt;http://web9ecf9dd.titan.studiocoast.com.au/&lt;/a&gt;.&amp;#160; Over the next few days I’m going to add several articles which explain how to get up and running using Graffiti and you will see the topics of these articles from the text in square brackets in the bullet pointed list below.&lt;/p&gt;  &lt;p&gt;The things that I like about Graffiti CMS are that: &lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;It is .NET based. I am a .NET developer and I really need my tool of choice to have a .NET flavor to it so that I can feel confident that I have full control over the final product. [Using Macros and Chalk Extensions] &lt;/li&gt;    &lt;li&gt;It is lightweight. In fact it&#39;s probably the lightest of all CMS engines that I know of relative to the number of features and amount of power that it affords. In fact, from the time you download Graffiti CMS, you can be up and running in under a minute if you choose the MS Access data provider. [Getting Started with Graffiti CMS] &lt;/li&gt;    &lt;li&gt;It gives me full control over the rendered HTML - Graffiti CMS layout templates are very powerful. [Understanding Graffiti Layouts and Templates] &lt;/li&gt;    &lt;li&gt;It&#39;s extensible. I can create custom extensions very easily to do pretty much whatever I want. [Developing your own custom Chalk Extension] &lt;/li&gt;    &lt;li&gt;It comes with lots of rich features that make it very easy to quickly build and deploy advanced websites. [Users and Permissions], [Themes] &lt;/li&gt;    &lt;li&gt;It&#39;s open source and it&#39;s free.&amp;#160; &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Further Reading&lt;/strong&gt;     &lt;br /&gt;&lt;a href=&quot;http://misfitgeek.com/blog/community/my-move-to-graffiti/&quot; target=&quot;_blank&quot;&gt;My Move to Graffiti&lt;/a&gt; - nice comparison of different tools &lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://2010wave.blogspot.com/feeds/8727802058269112108/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://2010wave.blogspot.com/2010/03/graffiti-cms.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8879753012890807179/posts/default/8727802058269112108'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8879753012890807179/posts/default/8727802058269112108'/><link rel='alternate' type='text/html' href='http://2010wave.blogspot.com/2010/03/graffiti-cms.html' title='Learning how to use Graffiti CMS'/><author><name>Darren Neimke</name><uri>http://www.blogger.com/profile/04138573191558270297</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://markitup.com/images/MyPicture_Small.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8879753012890807179.post-2885843943059912805</id><published>2010-02-28T16:12:00.000-08:00</published><updated>2010-02-28T19:02:53.605-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="development"/><category scheme="http://www.blogger.com/atom/ns#" term="Process"/><title type='text'>Version Control - a reaction to Martin Fowler&#39;s article</title><content type='html'>Recently I&#39;ve been involved with looking at how our team produces software. This has meant looking across the spectrum of activities, tools, and practices that we undertake to deliver working software to the business. It was with this activity still fresh in my mind that I stumbled upon &lt;a href=&quot;http://martinfowler.com/bliki/VersionControlTools.html&quot;&gt;Martin Fowler&#39;s thoughtful article about Version Control&lt;/a&gt; on his Bliki earlier today.&lt;br /&gt;
&lt;br /&gt;
As part of my work I actually put forward an argument that we move away from using SVN for source control and to implement TFS. As somebody who has deep personal affection for the simplicity of SVN, the decision to recommend TFS was not made lightly.&lt;br /&gt;
&lt;br /&gt;
In light of my own decision to move away from SVN and onto TFS, I was motivated to respond to Martin&#39;s positioning of TFS on his summary diagram which placed TFS outside of the tools that he would recommend for version control.&lt;br /&gt;
&lt;br /&gt;
Whilst he suggests that TFS is not a recommendable product, Martin does not make any real attempt to explain other than to say that people he trusts don&#39;t recommend it. In this article I want to put forward some of the reasons that I chose for recommending TFS as our tool of choice.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Integration&lt;/b&gt;&lt;br /&gt;
I believe that it is unfair to look at version control in isolation because, whilst your version control software sits at the heart of your development system, it lives within a larger ecosystem. This ecosystem is made up of IDE&#39;s, Issue Tracking Software, Build Management Software, Continuous Integration Services, Reporting, and perhaps other tools and services too.&lt;br /&gt;
&lt;br /&gt;
In light of all of this software that comprises your development ecosystem, consider the technology soup that you are managing. Patching and keeping these systems soon becomes a science unto itself and unless you&#39;re job is as a specialist build master where you are entitled to choose individual best of breed applications, managing this type of environment may not be for you.&lt;br /&gt;
&lt;br /&gt;
Moving to TFS provides us with a single technology roadmap and vastly reduces the complexity involved in configuring and patching our environment when compared with the alternative.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;An illusion of simplicity&lt;/b&gt;&lt;br /&gt;
In light of having uncovered the elements of a development ecosystem, let&#39;s reconsider our views on simplicity. First I&#39;ll start with a statement from my own observations about developing software - Developing software is a complex business. FULLSTOP! PERIOD!&lt;br /&gt;
&lt;br /&gt;
As shown in my previous discussion about integration, the complexity is there always. You can have a simple version control tool but the cost of this is that you transfer more of the complexity to other parts of the system. In the case of having chosen SVN, this complexity comes in the form of having to run multiple, independant systems using multiple technologies.&lt;br /&gt;
&lt;br /&gt;
With TFS you gain simplicity through technology consolidation but you pay a price for having to learn how to set up and manage it - but is this any more complex than having to learn half a dozen other systems?&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;The real business world&lt;/b&gt;&lt;br /&gt;
So far I&#39;ve focussed my discussion about the development ecosystem on the activities of the developers themselves. However in the real business world, this is still not a fair representation of what is needed to successfully deliver working software.&lt;br /&gt;
&lt;br /&gt;
Even small businesses have stakeholders that the software is being developed for and in mature businesses, there is an instrument which sits between (or straddles) the business and technology domain - this instrument is the PMO.&lt;br /&gt;
&lt;br /&gt;
In light of this discovery, it is no surprise that building successful software is as much about soft skills - such as communication and reporting - as it is about purely technical pursuits such as coding, building, and releasing.&lt;br /&gt;
&lt;br /&gt;
By integrating with common business software such as Excel and MS Project, the TFS work item&amp;nbsp;tracking system makes it easier to align IT projects with projects in the PMO and have those functions be able to communicate using a common language.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Conclusion&lt;/b&gt;&lt;br /&gt;
In this article I have opposed Martin Fowler&#39;s view in relation to the placement of TFS on his summary diagram. I believe that his article is too narrowly focussed to be of real value when considering what tools to choose in creating your own software development ecosystem.&lt;br /&gt;
&lt;br /&gt;
However I do agree with his closing sentiments wholeheartedly and I could not have put it any better then when he wrote:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;&lt;i&gt;Remember that although I&#39;ve jabbered on a lot about tools here, often its the practices and workflows that make a bigger difference. Tools can certainly make it much easier to use a good set of practices, but in the end it&#39;s up to the people to use an effective way of working for their environment. I like to see approaches that allow many small changes that are rapidly integrated using Continuous Integration. I&#39;d rather use a poor tool with CI than a good tool without.&amp;nbsp;&lt;/i&gt;&lt;/blockquote&gt;</content><link rel='replies' type='application/atom+xml' href='http://2010wave.blogspot.com/feeds/2885843943059912805/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://2010wave.blogspot.com/2010/02/version-control-reaction-to-martin.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8879753012890807179/posts/default/2885843943059912805'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8879753012890807179/posts/default/2885843943059912805'/><link rel='alternate' type='text/html' href='http://2010wave.blogspot.com/2010/02/version-control-reaction-to-martin.html' title='Version Control - a reaction to Martin Fowler&#39;s article'/><author><name>Darren Neimke</name><uri>http://www.blogger.com/profile/04138573191558270297</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://markitup.com/images/MyPicture_Small.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8879753012890807179.post-6376928021639570783</id><published>2010-02-09T19:01:00.000-08:00</published><updated>2010-02-09T19:01:36.054-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="development"/><category scheme="http://www.blogger.com/atom/ns#" term="leadership"/><title type='text'>Productive Software Development</title><content type='html'>&lt;div class=&quot;MsoNormal&quot;&gt;Today I read through a thoughtful set of blog posts (about 7 in total) on the topic of software and exerting control over it:&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;a href=&quot;http://blog.scottbellware.com/2010/02/to-control-and-observe-productive.html&quot;&gt;http://blog.scottbellware.com/2010/02/to-control-and-observe-productive.html&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;At the bottom of each post is a “Next” link which takes you to the next article.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;If you have time to read it I would recommend it and if you do, think in terms of how a chunk of software should look in order that you can examine it under controlled conditions.&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;These things lie at the heart of the management of &lt;a href=&quot;http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod&quot;&gt;dependency management&lt;/a&gt; and &lt;a href=&quot;http://www.artofunittesting.com/&quot;&gt;testing&lt;/a&gt;.&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;The author (&lt;a href=&quot;http://twitter.com/ampgt&quot;&gt;Scott Bellware&lt;/a&gt;) leads us to think about how we use efficiency as a lever – and what the consequences of that can be – was also a thoughtful exercise.&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;The article also spoke to me in other ways.&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;An additional concept that I drew out while reading this text was that of authenticity and the motivation that I have for the things that I&#39;m responsible for.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;As mentioned by &lt;a href=&quot;http://twitter.com/kzu&quot;&gt;@kzu&lt;/a&gt;, &lt;a href=&quot;http://www.clariusconsulting.net/blogs/kzu/archive/2010/02/08/SoftwareDevelopmentProductivity.aspx?&quot;&gt;this is a verbose style&lt;/a&gt;, but a story well told and one which contains some very useful and valid points.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://2010wave.blogspot.com/feeds/6376928021639570783/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://2010wave.blogspot.com/2010/02/productive-software-development.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8879753012890807179/posts/default/6376928021639570783'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8879753012890807179/posts/default/6376928021639570783'/><link rel='alternate' type='text/html' href='http://2010wave.blogspot.com/2010/02/productive-software-development.html' title='Productive Software Development'/><author><name>Darren Neimke</name><uri>http://www.blogger.com/profile/04138573191558270297</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://markitup.com/images/MyPicture_Small.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8879753012890807179.post-1918910960567124850</id><published>2010-02-08T01:27:00.001-08:00</published><updated>2010-03-26T11:51:27.423-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Architecture"/><category scheme="http://www.blogger.com/atom/ns#" term="SharePoint"/><title type='text'>SharePoint (2007 or 2010) Architecture - Part 2: An MVC Style Implementation</title><content type='html'>Recently I started a code refactoring exercise for some SharePoint code and here I will lay out a very simple architecture that I have implemented for creating web part views. I want to start here because this is the beginning. In a future post I will show you how to refactor this code to introduce more and more patterns of encapsulation to show you how we can grow to accommodate new needs.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;The cost of impedance mismatches&lt;/strong&gt;&lt;br /&gt;
Remember in the first article that I presented an image to highlight how implementations can differ.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgs6plxP6wFVRUSC3LNff8bzq0wPAY7NXez7Pp0bf01qPXFypGkWalx_E7Xn_FNgQj7wUPyIMNYWui-IAvKuGIyBcgWrvo0RgLiZu1OdGf0jZGh0TIcGVOthaPnXsHh-EbHW-W4ABLKxgXZ/s1600-h/image%5B3%5D.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;233&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9y37mT5KmzUo57m0VnauwLeSPYOFDBPWsWnHpXUV37vzprzks2ifW2qtC2ZWMkoeBQ69IN-Y6qDXrJUbZjT9wEeDK1N5tgRAj-K23sES7J-sQ6f9_brFNRADxVItmnesVt8WCf-pKY_V3/?imgmax=800&quot; style=&quot;border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline;&quot; title=&quot;image&quot; width=&quot;371&quot; /&gt;&lt;/a&gt; &lt;br /&gt;
&lt;br /&gt;
A major reason for this difference is that, in the absence of clear protocols and contracts, information can easily be lost during communication of expectations. And in the face of differing expectations and outcomes, the result can lead to changes that are hard to check for conformance and difficult to estimate for the purposes of cost.&amp;nbsp; Additional costs can include excessive rework.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPXW4rGylTa9jUgYLUVWPeiwPl9WtruJVqCj2R0ej8qXByArnoJ5Q-9YDzVpYtQgVwlWbFu1Qm2BTAXGsyOVRNqAHvU5AzR6hcrvMN8lYEkxNnoI3YbRsUJD_RizuHW3L3VkYyKItenNgt/s1600-h/image%5B7%5D.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;122&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGrNTRBQvXkini_3VyodsmjYbAI0GLFGjYD9DKf0yAolZbOOZ132FFVmkX9i1HnJdtRBWoFsfn9QESL5OPAmHGrN4wiktcX5nqZJ1gHZtcg_9_sKGs01jbcIEdzp0OQoF0THWCS1s9YcVC/?imgmax=800&quot; style=&quot;border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline;&quot; title=&quot;image&quot; width=&quot;508&quot; /&gt;&lt;/a&gt; &lt;br /&gt;
&lt;br /&gt;
So the implementation that I will talk through in this article is primarily designed to introduce a degree of conformance and consistency into the development process. Whilst the code artifacts that will result from this article may violate some architectural norms, what we will be left with will form a good base from which to build upon and should lend itself to enough abstraction that it can easily be factored and improved over time without making the overall application unnecessarily unstable.&lt;br /&gt;
&lt;strong&gt;&lt;br /&gt;
&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;Separating out the database access code     &lt;br /&gt;
&lt;/strong&gt;The first thing that I’ll do is to create a custom Command abstraction to encapsulate the execution of my data access code.&amp;nbsp; The Command will fetch data from a repository somewhere and return me some domain objects to work with further up in my architectural stack.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhaW6or5kF7ZRNwiENvB6MYtECWwPyVYDPb0sca308hoUwv3zwdOQif3ePvwD75IkdPmhf22J_0N3ucpqVNknVi0gDYJxs99NzGmc6DtIhTHbf5wu7qwqOmgB0XXkHHpXQvASTbqqLJOThw/s1600-h/image%5B11%5D.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;309&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0ybfyqn3yjp_IBipD0h5DVidlITlf3teH6WhVy_bOgHUdnqT-k9LdCeuKDCEIjvFUvrxJ2c29bMogk1VBlNgEsu96OkPgQMeOuBVLlFOMYBGurBw7LWJIxGiEUiY14jtTaOl7QIa9DiH_/?imgmax=800&quot; style=&quot;border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline;&quot; title=&quot;image&quot; width=&quot;340&quot; /&gt;&lt;/a&gt; &lt;br /&gt;
&lt;br /&gt;
In my application there will be a base Command abstraction that will form the base of more repository specific classes of Commands.&amp;nbsp; Each of these repository specific classes of Commands would have understand how to connect and communicate with repositories of a specific type, e.g. SQL repositories, SharePoint repositories, File System&#39;s etc.&lt;br /&gt;
&lt;br /&gt;
And then those repository specific Commands will get sub-classed into specific, domain-specific commands.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjShDXXNh-bCq5PaBa60euXBYAbhJfbusfTJOfFOmM2CohR_Bs1X2e6rRxhiHPbB3V_CrEA3a-VrpN5PN_EOFMVSxjeeTt-3Lxw9EDG-LfphBGBpn_Y1oAJU_-Ip2l2y356Tut8P70iAWOI/s1600-h/image%5B15%5D.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;275&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhuoqt942_CjW9Wm2BYBy3mOh_HyL8-bwmYYpPJGh4MMB7L0N8t_dcdrOUt7PzY8lZcLwFp-uUWhNiVfhg8cG9inmeQTGEWH1Sk6X6fXNjZLhtQH3IkhHsd1OClby8Xt8Cabya06YbjBzUA/?imgmax=800&quot; style=&quot;border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline;&quot; title=&quot;image&quot; width=&quot;390&quot; /&gt;&lt;/a&gt; &lt;br /&gt;
&lt;br /&gt;
At the bottom of the class hierarchy for commands we have a simple abstraction of a base Command class. This class defines a template with an Execute method and returns strongly typed results via a Result property:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;abstract&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; Command&amp;lt;T&amp;gt; 
{
&lt;span class=&quot;kwrd&quot;&gt;    protected&lt;/span&gt; T _result = &lt;span class=&quot;kwrd&quot;&gt;default&lt;/span&gt;(T);

&lt;span class=&quot;kwrd&quot;&gt;    public&lt;/span&gt; T Result { get { &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;._result ; } }

&lt;span class=&quot;kwrd&quot;&gt;    public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;abstract&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; Execute();
} &lt;/pre&gt;&lt;br /&gt;
Sitting above the base Command class we have specific abstractions for the various different types of repositories that we are accessing. In the case of SQL repositories, I am specifying via constructor constraints that any SQL commands are dependant upon receiving a connection string and a commands.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;abstract&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; SQLCommand&amp;lt;T&amp;gt; : Command&amp;lt;T&amp;gt;
{
&lt;span class=&quot;kwrd&quot;&gt;    protected&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; connectionString = &lt;span class=&quot;str&quot;&gt;&quot;&quot;&lt;/span&gt;;
&lt;span class=&quot;kwrd&quot;&gt;    protected&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; commandText = &lt;span class=&quot;str&quot;&gt;&quot;&quot;&lt;/span&gt;;

&lt;span class=&quot;kwrd&quot;&gt;    public&lt;/span&gt; SQLCommand(&lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; connectionString, &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; commandText) 
    {
&lt;span class=&quot;kwrd&quot;&gt;   &amp;nbsp;    &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (&lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt;.IsNullOrEmpty(connectionString)) {&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;   &amp;nbsp;   &amp;nbsp;    &lt;span class=&quot;kwrd&quot;&gt;throw&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; ArgumentNullException(&lt;span class=&quot;str&quot;&gt;&quot;connectionString&quot;&lt;/span&gt;);&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&amp;nbsp;       }&lt;/pre&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;   &amp;nbsp;    &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (&lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt;.IsNullOrEmpty(commandText)) {&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;   &amp;nbsp;   &amp;nbsp;    &lt;span class=&quot;kwrd&quot;&gt;throw&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; ArgumentNullException(&lt;span class=&quot;str&quot;&gt;&quot;commandText&quot;&lt;/span&gt;);&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&amp;nbsp;       }&lt;/pre&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;
&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;   &amp;nbsp;    &lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;.connectionString = connectionString;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;   &amp;nbsp;    &lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;.commandText = commandText;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;csharpcode&quot;&gt;}

&lt;span class=&quot;kwrd&quot;&gt;    public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;override&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; Execute() { }
}  &lt;/pre&gt;&lt;br /&gt;
And finally, at the top level we have specific commands. Here is an example of a Command which encapsulates the logic for getting information about the daily weather from a SQL repository.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; GetWeatherCommand : SQLCommand&amp;lt;WeatherInformation&amp;gt; {

&lt;span class=&quot;kwrd&quot;&gt;    const&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; _commandText = &lt;span class=&quot;str&quot;&gt;&quot;spGetDailyWeather&quot;&lt;/span&gt;;

&lt;span class=&quot;kwrd&quot;&gt;    public&lt;/span&gt; GetWeatherCommand(&lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; connectionString) 
   &amp;nbsp;    : &lt;span class=&quot;kwrd&quot;&gt;base&lt;/span&gt;(connectionString, _commandText) { }&lt;/pre&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;/pre&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;    public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;override&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; Execute() {

   &amp;nbsp;    WeatherInformation weather = &lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt;;&lt;/pre&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;/pre&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;   &amp;nbsp;    &lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; (var cnn = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; SqlConnection(connectionString)) {&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&amp;nbsp;   &amp;nbsp;   &amp;nbsp;&lt;/pre&gt;&lt;pre class=&quot;csharpcode&quot;&gt;cnn.Open();&lt;/pre&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&amp;nbsp;   &amp;nbsp;       var cmd = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; SqlCommand(commandText, cnn);&lt;/pre&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;   &amp;nbsp;   &amp;nbsp;    &lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; (var reader = cmd.ExecuteReader()) {&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;   &amp;nbsp;   &amp;nbsp;   &amp;nbsp;    &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (reader.Read()) {&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&amp;nbsp;   &amp;nbsp;   &amp;nbsp;   &amp;nbsp;       weather = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; WeatherInformation()&lt;/pre&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&amp;nbsp;   &amp;nbsp;   &amp;nbsp;   &amp;nbsp;       {&lt;/pre&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&amp;nbsp;   &amp;nbsp;   &amp;nbsp;   &amp;nbsp;   &amp;nbsp;       Temperature = &lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt;.Parse(reader[0].ToString())&lt;/pre&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&amp;nbsp;   &amp;nbsp;   &amp;nbsp;   &amp;nbsp;       };&lt;/pre&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&amp;nbsp;   &amp;nbsp;   &amp;nbsp;       }&lt;/pre&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&amp;nbsp;   &amp;nbsp;       }&lt;/pre&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&amp;nbsp;   &amp;nbsp;   }&lt;/pre&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;   &amp;nbsp;    &lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;._result = weather;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&amp;nbsp;   }&lt;/pre&gt;&lt;pre class=&quot;csharpcode&quot;&gt;} &lt;/pre&gt;&lt;br /&gt;
Over time we can identify ways to refactor our commands by pulling apart and pushing specific pieces of logic further down our Command stack. For example, it may be that the job of creating and managing the lifetime of connection objects are pushed into the base SQL command or that we further abstract the data reading and handling process so that we don&#39;t have messy parsing logic duplicated at this level.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Commands return custom entities&lt;/strong&gt;&lt;br /&gt;
Notice that the Command pattern allows for custom entities to be returned. This ensures not only that we enforce strong-typing throughout our solution but also so that we properly abstract and encapsulate our entities and protect our application from changes that we might make such as changing the underlying behavior or version changes such as newly added properties that our entities might take on.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Modelling view logic&lt;br /&gt;
&lt;/strong&gt;View modelling allows us to simplify UI logic - and by separating responsibilities it also helps to keep our HTML &quot;clean&quot;. For example, in our example we may have other information that we can infer from our Temperature entity that will be useful to display to our users. An example might be that we want to display a different CSS color based on what range the temperature falls within. In this case we can model that logic in a view model class that we can later bind directly to a UI layout template:&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: monospace; white-space: pre;&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; DailyWeatherViewModel &lt;/span&gt;&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;{
&lt;span class=&quot;kwrd&quot;&gt;    private&lt;/span&gt; WeatherInformation weather = &lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt;;

&lt;span class=&quot;kwrd&quot;&gt;    public&lt;/span&gt; DailyWeatherViewModel(WeatherInformation weather) {
&lt;span class=&quot;kwrd&quot;&gt;   &amp;nbsp;    &lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;.weather = weather;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;csharpcode&quot;&gt;}

&lt;span class=&quot;kwrd&quot;&gt;    public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt; Temperature {
   &amp;nbsp;    get {&lt;/pre&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;   &amp;nbsp;   &amp;nbsp;    &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;.weather.Temperature;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&amp;nbsp;       }&lt;/pre&gt;&lt;pre class=&quot;csharpcode&quot;&gt;}

&lt;span class=&quot;kwrd&quot;&gt;    public&lt;/span&gt; TemperatureRange TemperatureRange {
   &amp;nbsp;    get {&lt;/pre&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;   &amp;nbsp;   &amp;nbsp;    &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (&lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;.Temperature &amp;lt; 0)&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;   &amp;nbsp;   &amp;nbsp;   &amp;nbsp;    &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; TemperatureRange.VeryCold;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;   &amp;nbsp;   &amp;nbsp;    &lt;span class=&quot;kwrd&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (&lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;.Temperature &amp;lt; 15)&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;   &amp;nbsp;   &amp;nbsp;   &amp;nbsp;    &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; TemperatureRange.Cool;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;   &amp;nbsp;   &amp;nbsp;    &lt;span class=&quot;kwrd&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (&lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;.Temperature &amp;lt; 25)&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;   &amp;nbsp;   &amp;nbsp;   &amp;nbsp;    &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; TemperatureRange.Mild;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;   &amp;nbsp;   &amp;nbsp;    &lt;span class=&quot;kwrd&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (&lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;.Temperature &amp;lt; 35)&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;   &amp;nbsp;   &amp;nbsp;   &amp;nbsp;    &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; TemperatureRange.Hot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;   &amp;nbsp;   &amp;nbsp;    else&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;   &amp;nbsp;   &amp;nbsp;   &amp;nbsp;    &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; TemperatureRange.VeryHot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&amp;nbsp;       }&lt;/pre&gt;&lt;pre class=&quot;csharpcode&quot;&gt;}
}

&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;enum&lt;/span&gt; TemperatureRange : &lt;span class=&quot;kwrd&quot;&gt;short&lt;/span&gt; 
{
    VeryHot,
    Hot,
    Mild,
    Cool,
    VeryCold,
} &lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
Looking at the Core project now we can see that code that was required so far. Here we see that we have our SQL Command class which will return an entity and that we also have a separate abstraction for our view logic.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1k6fAjNalSL7WoOy8Ifv6YLdphrcOedIaPndtfvA0QZa3po8esB6Yy5pTi0X3wmpJYeBS0dBWWvMWlS-pMxAMD4FuUiKMTpfcxQAljxRVnr-XKs30JTaCB-fhxOyrSf1i9RcmNbgtrUe9/s1600-h/image%5B19%5D.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;332&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-r61kRiqyb_53rRxq-ls2o6Pbg7lDhFgHxvGMGTzfNkB-asfmPdey33qBgbh5Aa3VpOp4kQblRcQN7ANT4UB1HX0jIrBoK4eX3vV3igAR3C0s0ejCKIy8biU_0RFtWY0mFiQJkbyOUTGc/?imgmax=800&quot; style=&quot;border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline;&quot; title=&quot;image&quot; width=&quot;275&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Separating view layout from code&lt;br /&gt;
&lt;/strong&gt;By using a HTML Template for the layout view we get benefits such as having designers who are able to work on the user interface and also a good separation of concerns between layout and application logic.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyMYqVpgCd_VlaZZjWv2OmyZ5eLZY2P8V2OLS18oL2hGCAItK0RhYk3rB8Y0VBIeEjHt9hjaabKoGWsLj-rjzfynocaB7KxQg9uO83aO5WMKjJZLQDTABKEYNP5ZzZxGJLCxQw5rs8kv_k/s1600-h/image%5B23%5D.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;284&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7TEM0eEbYRu7CcWv2tx8rykj4ISsrUc-1esk6s-eTooZu9JEvgwJNd3ufxa4z6U3O8Xk47Du8fFLzNHcOnjpxPPUNLmUQa8Z0_Trg5L1ri3YVHa3dRFn3271LLr87WHCrqVrsiCRbcHBF/?imgmax=800&quot; style=&quot;border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline;&quot; title=&quot;image&quot; width=&quot;374&quot; /&gt;&lt;/a&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the case of this Weather component, I might initially choose a simple layout as shown in the following code snippet, but it is still a simple exercise to change this over when the designer comes back with a new layout template later.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;div&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;BirthdayText&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
    The temperature is: &lt;span class=&quot;asp&quot;&gt;&amp;lt;%&lt;/span&gt;= &lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;.Model.TemperatureRange &lt;span class=&quot;asp&quot;&gt;%&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;    &amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;img&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;/_layouts/&amp;lt;%= this.Model.TemperatureRange.ToString() %&amp;gt;&quot;&lt;/span&gt;
&lt;span class=&quot;attr&quot;&gt;   &amp;nbsp;    &lt;span class=&quot;attr&quot;&gt;alt&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;&amp;lt;%= this.Model.TemperatureRange.ToString() %&amp;gt;&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt; &lt;/pre&gt;&lt;br /&gt;
The code behind for this HTML template might look something like this standard piece of ASP.NET codebehind:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;partial&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; DailyWeatherControl : UserControl {

&lt;span class=&quot;kwrd&quot;&gt;    public&lt;/span&gt; DailyWeatherControl() { }

    DailyWeatherViewModel model;

&lt;span class=&quot;kwrd&quot;&gt;    public&lt;/span&gt; DailyWeatherViewModel Model {
   &amp;nbsp;    get {&lt;/pre&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;   &amp;nbsp;   &amp;nbsp;    &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;.model;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&amp;nbsp;       }&lt;/pre&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&amp;nbsp;       set {&lt;/pre&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;   &amp;nbsp;   &amp;nbsp;    &lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;.model = &lt;span class=&quot;kwrd&quot;&gt;value&lt;/span&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&amp;nbsp;       }&lt;/pre&gt;&lt;pre class=&quot;csharpcode&quot;&gt;}
} &lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Web part as the coordinator&lt;br /&gt;
&lt;/strong&gt;Back in part 1, I mentioned that I look at Web Part code to only have up to 120 lines of code. These lines of code will be somewhat dependent on how much event handling your web part has to do, but you can use 120 lines as a baseline for a simple Web Part which simply renders data and handles little or no user input.&lt;br /&gt;
&lt;br /&gt;
In such a case the Web Part is responsible for orchestration and coordination of the flow of control. The Web Part will create instances of commands and view models; it will instantiate layout templates and pass the view models to them. Very simple indeed.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiaCSi7_AkiMPcZcMZEG_7JvK2ni7ooG893ZZECH0vAPsocoq_iFTYJEpl1DQ49EMT9tfeCSl9u5u_Fb58NomDVX4V4Qjce8zTCEQxgpGKBIIoNr74j9E9dz7yJ42TuFIaoI3YWQj4OMNEt/s1600-h/image%5B27%5D.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;215&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdFLOGsjPzdH6TjnSOQh6YXJwEBCnOq2mk_mK3UpC1aIdAqJIUztGT4gI-S2ct1qizI7dLZ8eOMX5edPxRYcEA6YH_l56bcmUDRkKsBnrh47CERde7v3DVerPSmnAS9b1wT_lywbIb41T-/?imgmax=800&quot; style=&quot;border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline;&quot; title=&quot;image&quot; width=&quot;423&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For our Web Part class...&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: monospace; white-space: pre;&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; DailyWeatherWebPart : System.Web.UI.WebControls.WebParts.WebPart {&lt;/span&gt;&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;    protected&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;override&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; OnLoad(EventArgs e) {
&lt;span class=&quot;kwrd&quot;&gt;   &amp;nbsp;    &lt;span class=&quot;kwrd&quot;&gt;base&lt;/span&gt;.OnLoad(e);&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;   &amp;nbsp;    &lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;.EnsureChildControls();&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;csharpcode&quot;&gt;}

&lt;span class=&quot;kwrd&quot;&gt;    protected&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;override&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; CreateChildControls() {

&lt;span class=&quot;kwrd&quot;&gt;   &amp;nbsp;    &lt;span class=&quot;kwrd&quot;&gt;base&lt;/span&gt;.CreateChildControls();&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;
&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&amp;nbsp;    var connectionString = ConfigurationManager.ConnectionStrings[&lt;span class=&quot;str&quot;&gt;&quot;AppSqlConn&quot;&lt;/span&gt;].ConnectionString;&lt;/pre&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&amp;nbsp;    var weatherCommand = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; GetWeatherCommand(connectionString);&lt;/pre&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&amp;nbsp;    weatherCommand.Execute();&lt;/pre&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;/pre&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&amp;nbsp;    DailyWeatherControl weatherControl =&amp;nbsp;&lt;/pre&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&amp;nbsp;      (DailyWeatherControl)Page.LoadControl(&lt;span class=&quot;str&quot;&gt;&quot;~/_controltemplates/Neimke/WebParts/DailyWeatherControl.ascx&quot;&lt;/span&gt;);&lt;/pre&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;   &amp;nbsp;    &lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;.Controls.Add(weatherControl);&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&amp;nbsp;    weatherControl.Model = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; DailyWeatherViewModel(weatherCommand.Result);&lt;/pre&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;/pre&gt;&lt;pre class=&quot;csharpcode&quot;&gt;}
} &lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
From here we might eventually decide to abstract further the complexities of template instantiation and error handling to another base class.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;What have we achieved?&lt;br /&gt;
&lt;/strong&gt;I mentioned at the start of this article that the architecture that we created would provide us with a good base from with to establish norms and standards. And that what we create should lend itself to improvement through further refactoring. And you will recall that I sought to provide a solution to having developers who produce expected outcomes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEif21qhIxeUAMyrQgDo7K-kejgFj2t7jwOsKSuVE0oI7NjcTv2LKuMCZp_ImKlmTTGTbblIdH8vParpflgTCC94QcvPulhujHG61XwdIDR_hTR1kIjCLJykpXCON-51dqfdfBy1EHkHRQhe/s1600-h/image%5B31%5D.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;105&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-yP7kmH4A0WUTD-w27M0yg9ZUQYKyTfujMB2q5DLTN5AxYbfeJbjq8gC64nxHDjFMNdcgR0M9W-LiE8qLiwWZwOA63SG44h2vqHO0OqF0uCWuaHmsrMdTP-o8MGOARNzCPQdfZePNz6gx/?imgmax=800&quot; style=&quot;border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline;&quot; title=&quot;image&quot; width=&quot;526&quot; /&gt;&lt;/a&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Given the architecture that I have presented, I could now expect that, when I ask for web part to be developed, I already know what the delivery should look like:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;A Command &lt;/li&gt;
&lt;li&gt;An Entity &lt;/li&gt;
&lt;li&gt;A ViewModel &lt;/li&gt;
&lt;li&gt;An HTML Layout Template &lt;/li&gt;
&lt;li&gt;A Web Part class&lt;/li&gt;
&lt;/ul&gt;This makes the job of passing or failing code based on conformance much simpler. And by being able to have such disciplines at play within our development team should ultimately lead to higher quality outcomes.&lt;br /&gt;
&lt;br /&gt;
The final layout of our solution looks like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOoZN-WUuGxQi5GobZsXwzrxE0udgfezmqNjAVzlWPYq-TS2BQo1kQ2qu0nM-MYCY1lMsDYDTO_lPqdA0h2R0XFGn_Mlbd0-ytVCxmlausj2H2Llyc7bYiwSzVNx_O326TkrUzdIOt-jFP/s1600-h/image%5B36%5D.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;564&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisNoipz2SC4AFFL61VnmDV-La-sWr7-lMsdvriesF2JkmXRDDtvgJpy6nek14B-mwE2Vhx0CYP2eRWyp7KqwA165lxzuVoKynxhYgI6oUqpiV1ETB77OQx4dK62Ix9LlsIW4rq1YtFoc-r/?imgmax=800&quot; style=&quot;border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline;&quot; title=&quot;image&quot; width=&quot;320&quot; /&gt;&lt;/a&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Where to from here?…&lt;/strong&gt;&lt;br /&gt;
&amp;nbsp;In the next article I want to take the code refactoring deeper to look at how we might introduce new patterns that will allow us to increase the testability of our code.</content><link rel='replies' type='application/atom+xml' href='http://2010wave.blogspot.com/feeds/1918910960567124850/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://2010wave.blogspot.com/2010/02/sharepoint-architecture-part-2-mvc.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8879753012890807179/posts/default/1918910960567124850'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8879753012890807179/posts/default/1918910960567124850'/><link rel='alternate' type='text/html' href='http://2010wave.blogspot.com/2010/02/sharepoint-architecture-part-2-mvc.html' title='SharePoint (2007 or 2010) Architecture - Part 2: An MVC Style Implementation'/><author><name>Darren Neimke</name><uri>http://www.blogger.com/profile/04138573191558270297</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://markitup.com/images/MyPicture_Small.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9y37mT5KmzUo57m0VnauwLeSPYOFDBPWsWnHpXUV37vzprzks2ifW2qtC2ZWMkoeBQ69IN-Y6qDXrJUbZjT9wEeDK1N5tgRAj-K23sES7J-sQ6f9_brFNRADxVItmnesVt8WCf-pKY_V3/s72-c?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8879753012890807179.post-3810589676389653329</id><published>2010-02-07T11:55:00.001-08:00</published><updated>2010-03-26T11:51:51.061-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Architecture"/><category scheme="http://www.blogger.com/atom/ns#" term="SharePoint"/><title type='text'>SharePoint (2007 or 2010) Architecture - Part 1: Building a case for quality</title><content type='html'>&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEheCY3HmwFz_dvhqTdZUAjt9hKeyzQ2VQv0vhgtOVYlSMRTfC6FYVKLH-9SPO9SP5gtAtOlihKasHKZlivxa916zVgmw7nFrQqEbqOtfJM4fp6KsgPAWQf4fxzo1uC4U5jvvRdlQ5L867nf/s1600-h/image%5B8%5D.png&quot;&gt;&lt;img align=&quot;right&quot; alt=&quot;image&quot; border=&quot;0&quot; height=&quot;301&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguR5bYha8hG8EM896BuxU_p8FSXr7DMx0xMr2cS8FEL_kSf-ZOmsUGzZ5BOv0aMhHZsvzs6vrMMl4jUcbM96lgsuTRiXjinkmnr940Wn7SyaAqiTrmsIAotMMCUoaiP6fY-C1wkROsPqqR/?imgmax=800&quot; style=&quot;border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; margin: 0px 0px 0px 10px;&quot; title=&quot;image&quot; width=&quot;220&quot; /&gt;&lt;/a&gt;In the wild, the development of SharePoint customizations is still a bit like the Wild West when compared to where things are at with other forms of modern software development. I&#39;m not blaming the developers or even the architects for this dilemma because developing and deploying custom software for SharePoint can be difficult - a bit like trying to swim against a strong tide. In this article I would like to explain some simple concepts that might make your overall SharePoint development and maintenance experience more bearable.&lt;br /&gt;
&lt;blockquote&gt;&lt;strong&gt;Note:        &lt;br /&gt;
&lt;/strong&gt;If you are developing solutions for SharePoint then you should also read &lt;a href=&quot;http://2010wave.blogspot.com/search/label/SharePoint&quot;&gt;my other SharePoint development articles&lt;/a&gt; and, in particular &lt;a href=&quot;http://2010wave.blogspot.com/2010/01/how-to-build-sharepoint-wsp-packages-as.html&quot;&gt;my article about using your build server to help make the process of deploying your customizations much nicer&lt;/a&gt;.&lt;/blockquote&gt;&lt;strong&gt;What is architecture?      &lt;br /&gt;
&lt;/strong&gt;Architecture refers to things that are designed and made by people. And the design is generally a carefully planned thing. This allows us to logically separate between things that a child might build with Lego, mud or clay and, let&#39;s say, the structure of a well-designed chair or a house.&lt;br /&gt;
Sometimes the code that gets deployed to SharePoint shares more in appearance with mud pies or messy piles of Lego than with a well-planned and organized room.&lt;br /&gt;
To be of a high good quality, it is required that both the architectural underpinnings of your code be strong and firm and also that the organization be consistent and well formed.&lt;br /&gt;
&lt;blockquote&gt;&lt;strong&gt;Note:        &lt;br /&gt;
&lt;/strong&gt;Fowler suggests architecture is the things that the senior developers on the team agree are probably important, and are hard to change. Re: the house, the architecture might be the direction it points, and whether it is one storey or two. The organization of the room is just code that&#39;s easily changed.&lt;/blockquote&gt;&lt;strong&gt;Why is architecture important?      &lt;br /&gt;
&lt;/strong&gt;Let&#39;s say that you produce a single web part and that you deploy it into SharePoint. For the next month or so you might get some change requests and you are happy to wear the pain of re-deploying it and everybody is happy. But multiply that pain by 3 or 4 (or more) developers and by 4 or 5 (or more) applications and by 3 or 4 (or more) features... and you are already in living, developer hell. And that&#39;s even before the first round of maintenance comes along from your initial deployments.&lt;br /&gt;
At this point in time - and I&#39;ll ask you to take another look at that scoop of spaghetti in the image - your agility and therefore your ability to change is gone! Before you know it, you are unable to meet the demands of the business and you are spending your nights working out how 4 year old code works.&lt;br /&gt;
&lt;strong&gt;Identifying good and bad code?      &lt;br /&gt;
&lt;/strong&gt;There are some worrying signs to look out for and code smells that you can observe in your SharePoint code repositories if you are hoping to avoid the aforementioned road to hell.&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Your web part classes have database access code in them &lt;/li&gt;
&lt;li&gt;Your web part classes have intimate knowledge of how to configure things &lt;/li&gt;
&lt;li&gt;Your web part classes have more than a couple of methods &lt;/li&gt;
&lt;/ul&gt;They are the commonsense metrics, now let me give you my gut-feel metric:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;If you have more than 120 lines of code - in total - in your web part class file then that is a &quot;smell&quot; and needs further investigation. And yes, that includes Namespace declarations and everything! &lt;/li&gt;
&lt;/ul&gt;If we apply good architecture and code organization techniques to our SharePoint coding, then our code will be well factored and easily understood across the whole team. It will be easier to change and manage.&lt;br /&gt;
&lt;strong&gt;How chaos occurs – a short walk through&lt;/strong&gt;&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwQU6E41CenTqG8Ts3f_itRfQF6u1-yGyDU1KBXK7elJtlTFUg6Wkcy_kgOvgYU55UHd3uAcCIBUrzNOndCEtqXmqckPkWKWF2wfOgNdiOzwl049X1Wp9IfKpnETnnLZyExhMFE_-FinSV/s1600-h/image%5B13%5D.png&quot;&gt;&lt;img align=&quot;left&quot; alt=&quot;image&quot; border=&quot;0&quot; height=&quot;237&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh14f935bt4DwLmhGpyfHuxpHzP_y3qUFpD-xha0fIipc6Kcka6tQmB7PH6WdtpXzgnIVBAGYko1eNeSyMdyp52eBRlKqTLHi1EJftjnH8ZR8oGWK8G2tRsFCcwOCbs29ENfIGFgkK_HEbo/?imgmax=800&quot; style=&quot;border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; margin: 0px 10px 0px 0px;&quot; title=&quot;image&quot; width=&quot;344&quot; /&gt;&lt;/a&gt; &lt;br /&gt;
A day comes when you need to develop a new Web Part and add it to your solution. You might come up with an idea for this web part and then ask one of your developers to implement it. Let&#39;s suggest that our code has an unclear architecture and that the organization of it is untidy. What will the developer deliver?&lt;br /&gt;
He may decide to implement a single web part class with lots of code in it. Code which connects to a database, grabs some data, caches it, and then sets out to render the user interface of the web part by reading through whatever object the database returned.&lt;br /&gt;
Alternatively your developer may choose to start creating a bunch of classes within your solution to do things. But what are these classes? What are they called? And are we happy with the concepts that are being introduced?&lt;br /&gt;
I&#39;m not saying that any of these things is necessarily the wrong thing, but in the absence of specific guidance and existing patterns, you can see how things can get rather messy indeed.&lt;br /&gt;
What you want is that, when you ask for the web part, you will know pretty much exactly what will be delivered in terms of a final set of artifacts.&amp;nbsp; So that what is built when creating one web part will be the same as what is built when creating the next one. Building upon common foundations and delivering with consistent organization.&lt;br /&gt;
&lt;strong&gt;Taking the architectural path      &lt;br /&gt;
&lt;/strong&gt;Think of your web part as you would any other architectural artifact and layer your software so that you have a sensible &lt;a href=&quot;http://en.wikipedia.org/wiki/Separation_of_concerns&quot;&gt;separation of concerns&lt;/a&gt; between each of the different functions within your application. But don&#39;t start by thinking that you have to build something that is perfect, there is no perfect. Perfect is whatever works best for you and your team. But we still need to work along common patterns and standards, so let&#39;s start with the some age old sensibilities and separate things along the lines of:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Models (getting our hands on the data) &lt;/li&gt;
&lt;li&gt;Views (showing awesome stuff to our users) &lt;/li&gt;
&lt;li&gt;Controllers (orchestrate the processes between data and view to ensure that things run smoothly) &lt;/li&gt;
&lt;/ul&gt;Notice that I didn&#39;t mention anything about choosing your favorite IoC container or how to create Mock classes for testing? I&#39;m just skimming across the top - because I am assuming that your team needs time to learn how to get better. The low hanging fruit is what is important when you are trying to improve your coding standards... you don&#39;t need to start at the lowest level.&amp;nbsp; &lt;br /&gt;
My suggestion is that, when you are starting your improvement journey, be pragmatic, start somewhere around halfway between heaven and hell. Because &lt;a href=&quot;http://stackoverflow.com/questions/211414/is-premature-optimization-really-the-root-of-all-evil&quot;&gt;premature optimization is the root of all evil&lt;/a&gt;, and, while you can try to start out by cramming every concept that you’ve ever read about into your architecture right from the beginning, a lot of the time patterns within those architectures are put in place to solve problems that you may never even experience. So while your architecture might feel elegant... &lt;a href=&quot;http://en.wikipedia.org/wiki/You_ain&#39;t_gonna_need_it&quot;&gt;you ain&#39;t gunna need it&lt;/a&gt;!&lt;br /&gt;
In the next article I will talk through a specific implementation for a SharePoint Web Part and highlight its benefits.</content><link rel='replies' type='application/atom+xml' href='http://2010wave.blogspot.com/feeds/3810589676389653329/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://2010wave.blogspot.com/2010/02/sharepoint-architecture-part-1-building.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8879753012890807179/posts/default/3810589676389653329'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8879753012890807179/posts/default/3810589676389653329'/><link rel='alternate' type='text/html' href='http://2010wave.blogspot.com/2010/02/sharepoint-architecture-part-1-building.html' title='SharePoint (2007 or 2010) Architecture - Part 1: Building a case for quality'/><author><name>Darren Neimke</name><uri>http://www.blogger.com/profile/04138573191558270297</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://markitup.com/images/MyPicture_Small.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguR5bYha8hG8EM896BuxU_p8FSXr7DMx0xMr2cS8FEL_kSf-ZOmsUGzZ5BOv0aMhHZsvzs6vrMMl4jUcbM96lgsuTRiXjinkmnr940Wn7SyaAqiTrmsIAotMMCUoaiP6fY-C1wkROsPqqR/s72-c?imgmax=800" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8879753012890807179.post-4528494605594501595</id><published>2010-01-30T03:54:00.001-08:00</published><updated>2010-01-30T03:55:32.684-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Facebook"/><category scheme="http://www.blogger.com/atom/ns#" term="Silverlight"/><category scheme="http://www.blogger.com/atom/ns#" term="Social"/><category scheme="http://www.blogger.com/atom/ns#" term="Twitter"/><title type='text'>FUSE Labs and Social Media – Producing great tools for the wrong people?</title><content type='html'>&lt;p&gt;I never told many people about this but, last year I got pretty anxious for a while about the informal way that personal data had becoming readily available through social networking sites such as &lt;a href=&quot;http://facebook.com&quot; target=&quot;_blank&quot;&gt;Facebook&lt;/a&gt;, &lt;a href=&quot;http://www.linkedin.com/&quot; target=&quot;_blank&quot;&gt;LinkedIn&lt;/a&gt; and &lt;a href=&quot;http://twitter.com/&quot; target=&quot;_blank&quot;&gt;Twitter&lt;/a&gt;.&amp;#160; This was reinforced to me when rich clients such as &lt;a href=&quot;http://www.tweetdeck.com/&quot; target=&quot;_blank&quot;&gt;TweetDeck&lt;/a&gt; and &lt;a href=&quot;http://fishbowl.codeplex.com/&quot; target=&quot;_blank&quot;&gt;Fishbowl&lt;/a&gt; started coming out and I could see the real power of the API’s of these sites in full view.&amp;#160; Even more when I decided to go and take a peek at the API’s that Facebook makes available to developers and started to understand that I might be sharing personal information about my relationships or my location without even being fully aware who I was giving it to.&lt;/p&gt;  &lt;p&gt;I remember at the time being able to completely visualize what sort of tools the bad guys would be capable of creating if they really put their minds to it.&amp;#160; Not to belittle the efforts of the people who wrote TweetDeck and Fishbowl, but it’s really getting easy to build very rich dashboards to represent &lt;a href=&quot;http://www.readwriteweb.com/archives/social_graph_concepts_and_issues.php&quot; target=&quot;_blank&quot;&gt;social graphs&lt;/a&gt; and with a little additional logic, I could see that you could pivot around on this data in some really interesting ways.&lt;/p&gt;  &lt;p&gt;Fast forward 8 or 9 months and the game just keeps getting a whole lot more interesting with people such as &lt;a href=&quot;http://blog.twitter.com/2009/08/location-location-location.html&quot; target=&quot;_blank&quot;&gt;Twitter allowing applications to store the geolocation&lt;/a&gt; along with the other bits of the tweeted data.&amp;#160; This technical shift opens the door for new innovations to rise up in how we visualize information based on the location when it was being created.&amp;#160; The following image shows a picture of Bing’s new Twitter Map tool:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmjP3C7d0u0Cf6UDaVpGL01Eb6JnwbuejogN3h6EA66I_HfvbiRGGNukRwOouw9_lTdLKHOTS-9HmXzYfMmpNDG9yNXfCmS2OY87puuKoRJzqvPXmeLOy-USUpNw94W2LhM2l49d0k3TyL/s1600-h/image%5B3%5D.png&quot;&gt;&lt;img style=&quot;border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEicNjnpBfHno3xJ_R1dAISBW7rLDNxjjsvwhGb9VRWteqso-2smSlcyG6mYdzQePetbvQOCSt3wDpGtI6_LUnD5hjCdjYFWBIVDuKMESYUSd8dgzNZaceyc7yrn9q0AWYMfBQq2R-qLIeHu/?imgmax=800&quot; width=&quot;421&quot; height=&quot;281&quot; /&gt;&lt;/a&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;As you can see from this picture, I can see location-based tweets over time (past 7 days) and then I can use filters to isolate certain data (e.g.: view only tweets made by a single user).&amp;#160; Couple that with tools like the new &lt;a href=&quot;http://www.silverlight.net/content/samples/apps/facebookclient/sfcquickinstall.aspx&quot; target=&quot;_blank&quot;&gt;Silverlight 4 Client for Facebook&lt;/a&gt; and you start to understand how much intelligence you could build around this stuff:&lt;/p&gt;  &lt;p&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiK_bE-flWax5cAix4TC83_Hp88n9rfGyUiWcupg7cyS9vnhDR3uAi577iOlLYDwb_Kd2FERm4gaWNAH0b_hNP9bdQ3CIJn7FjYfycJYd3vPLXZFRTYiizd3TxmGhNnPLkGTUs6_6z3vhvG/s1600-h/image%5B7%5D.png&quot;&gt;&lt;img style=&quot;border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZdSWNa_SOqhnESF9ym_CVcDXuw2du7vA_RkNa8bOMTBXAaIQd730ebwVtPeOEp-brfG4ljS2y7-98t6gc2VUgNO_tFEY4te17b0THpRKS14kix1nVqFW-koHM_t8uIDw-iXqsgaMGHQDR/?imgmax=800&quot; width=&quot;371&quot; height=&quot;174&quot; /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Couple that with the potential reach that you get across a social graph from deploying Facebook applications and you could build a very interesting, location based “listener”.&amp;#160; Pictures, events, places, comments, and times.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Using technology for good&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;OK, so that’s enough paranoia, let’s look at what I think needs to happen to balance the scales a bit.&amp;#160; We know that technology can be a terrific aid in helping to uphold safety, just as it can be used for bad stuff.&amp;#160; Here is a link to the text from &lt;a href=&quot;http://www.microsoft.com/presspass/exec/steve/2010/01-27WWPSS.mspx&quot; target=&quot;_blank&quot;&gt;Steve Ballmer’s recent speech at the Worldwide Public Safety Symposium&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;In and of itself, Bing Twitter Maps is not massively useful right now.&amp;#160; For example a relatively minor number people are producing geo-coded tweets and so what you see when you look at this tool is a demonstration of capability.&amp;#160; But think about how useful tools such as this could be in a crisis sometime in the not too distant future.&amp;#160; A tool such as this could help somebody who was in distress to get a message out.&amp;#160; It could be used to monitor activity near the scene of a crime – such as a burglary – and it could help groups of people who are often in disparate locations to understand when they were located near other members of the group.&lt;/p&gt;  &lt;p&gt;For some of these types of scenarios to play out, I believe that we need more metadata so that different classes of information could be visualized in better ways.&amp;#160; Consider what could be done if there was a metadata standard for Twitter which was the equivalent of a 911 or emergency message.&amp;#160; Metadata such as this would allow individuals to send out distress signals and to perhaps have them acted upon.&lt;/p&gt;  &lt;p&gt;Similarly, what if there was the ability for certain agencies to annotate their data with certain information which carried special weight with regards to public interest?&amp;#160; Fire departments or local councils could start to create messages which plugged in to the raft of tools that are starting to emerge.&amp;#160; Imagine a social network dashboard which was able to interrupt you with an important announcement about an event which was occurring nearby to you.&lt;/p&gt;  &lt;p&gt;I think that as more standards start to emerge in the way that these types of information are transmitted, we will start to see some really amazing experiences being built and some which carry tremendous social responsibility messages to us.&amp;#160; &lt;/p&gt;  &lt;p&gt;Until that day arrives, maybe we will be dazzled by new rich renditions of information, but whether it has great application in our lives might be debatable.&amp;#160; With the current tools the way they are, I think that there’s more on offer for petty stalkers than there is for seriously digital communities, groups, and individuals.&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://2010wave.blogspot.com/feeds/4528494605594501595/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://2010wave.blogspot.com/2010/01/fuse-labs-and-social-media-producing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8879753012890807179/posts/default/4528494605594501595'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8879753012890807179/posts/default/4528494605594501595'/><link rel='alternate' type='text/html' href='http://2010wave.blogspot.com/2010/01/fuse-labs-and-social-media-producing.html' title='FUSE Labs and Social Media – Producing great tools for the wrong people?'/><author><name>Darren Neimke</name><uri>http://www.blogger.com/profile/04138573191558270297</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://markitup.com/images/MyPicture_Small.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEicNjnpBfHno3xJ_R1dAISBW7rLDNxjjsvwhGb9VRWteqso-2smSlcyG6mYdzQePetbvQOCSt3wDpGtI6_LUnD5hjCdjYFWBIVDuKMESYUSd8dgzNZaceyc7yrn9q0AWYMfBQq2R-qLIeHu/s72-c?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8879753012890807179.post-5037664135992738469</id><published>2010-01-26T02:05:00.001-08:00</published><updated>2010-01-26T12:23:12.057-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Azure"/><title type='text'>Creating and running an Azure package by hand</title><content type='html'>&lt;b&gt;Note&lt;/b&gt;: there appears to be a bug in this which is currently preventing the web application from &quot;spinning up&quot; on my machine. &amp;nbsp;I&#39;m not sure what the problem is but I will correct this post when I find it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Recently I was running a limited version of Visual Studio which didn’t allow me to build Azure packages because the VS and Azure bits were out of sync.&amp;nbsp; So I ended up having to build the Azure bits by hand and I thought that in this post I would share how that was done.&amp;nbsp; In this post we will create an ASP.NET MVC application and attach it to an Azure Web Role.&amp;nbsp; After that, we will deploy it to our development fabric and run it.&lt;br /&gt;
&lt;strong&gt;Create the ASP.NET MVC Application&lt;/strong&gt;&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Open Visual Studio, click &lt;strong&gt;New Project&lt;/strong&gt; and create a new &lt;strong&gt;ASP.NET MVC 2 Web Application&lt;/strong&gt; called HelloCloudService       &lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8CbQIViKKEdxUJqRFirtXchYEyzvvMxvN-TG1kj9FPVVNRUYc-Z30pRwSgRpvBx2G9OD-RMCDHJ_sc1UtYMnN3zTPBiLuhW0o6unprr6sAxHwwzTJUd5OgcPgjySxQBynyOKzmO5DZjuc/s1600-h/image8.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;326&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgq-Z2PuQPuH58lom5HlL1ZFrDQ1yTGtxbj3nHjIR2Th7GAopwVlZIQkXF2YEHjizqeBkBRVnp-fQmcED4WnMvRMXehBd2_AzIwgv_yhni2RDnUY0efbK7lwfZ8QalGV9h61cdYnuh0Nzxz/?imgmax=800&quot; style=&quot;border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline;&quot; title=&quot;image&quot; width=&quot;396&quot; /&gt;&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;Manually add a reference to the Azure .NET assemblies (these are located in the &lt;strong&gt;ref&lt;/strong&gt; folder where you installed the SDK – the default path is C:\Program Files\Windows Azure SDK\v1.0)       &lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_4wU0Oa7Y7zuaXkmXpJCdGGVoJE06vcrw0Jwhox4m1stpkMW3vIs65qbCY-gzldLWFv9961eQqdliWV34dQ3uGXrMVE2R4GJTJDdJtUpn7BAgwN90LyhTTKQiJsKNyxNCGVmF1LM2THof/s1600-h/image12.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;253&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEix8UfFqMwM-SwO_FnkAzpiSjNLhib9EYHyO0JV9fROaAlMTZofreT8zwMFPKo1ParvFRIhQ66McPjjSpjRcpoZBWgMRYur5PjI_NeeLDbgGy0b_071Pc57uTr8q4zQMxqpPQpk7hp9oFib/?imgmax=800&quot; style=&quot;border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline;&quot; title=&quot;image&quot; width=&quot;408&quot; /&gt;&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;Change your Index action so that it looks like this:      &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;public ActionResult Index()
{
    if (RoleEnvironment.IsAvailable)
    {
   &amp;nbsp;    ViewData[&quot;Message&quot;] = &quot;Welcome to the Cloud!&quot;; &lt;/pre&gt;&lt;pre class=&quot;csharpcode&quot;&gt;} else {
   &amp;nbsp;    ViewData[&quot;Message&quot;] = &quot;Welcome to ASP.NET MVC!&quot;; &lt;/pre&gt;&lt;pre class=&quot;csharpcode&quot;&gt;}

    return View();
}&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;Press F5 to run your web application and you should see that we are indeed NOT running in the Azure cloud fabric. &lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYFXGwpZSysgpo_0cSMz8Nvh7rc2PbdLxOWoZWlbBVgKvN5QGn5RRrlZ8HORKYHhy1w9HaZpyGu6v3I_SzTBvXMvW59eTfNP60zWqChffnbEJTX1gn0a7qbWnL3StC5CsbYRGgqAskEO_Z/s1600-h/image19.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;218&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwIoatUqP3yTYXn4A0q3TwemnBUTPz9PpbGPOe2L7khlekNdzX00gS4mkOetVcfzxUhm_smO72O2F0Emph4YxyL1pfsRUq1E2Cex6RfX5h2FSYGuXd-tT31tQoWg_A-0AEM9j_YF6heuH_/?imgmax=800&quot; style=&quot;border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline;&quot; title=&quot;image&quot; width=&quot;368&quot; /&gt;&lt;/a&gt; &lt;/li&gt;
&lt;/ol&gt;&lt;br /&gt;
&lt;strong&gt;Create the Web Role&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
Next we will create our Service Definition (.csdef) and a Service Configuration which matches it (.cscfg)&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Go to the folder which contains your Web Application project folder and create another folder alongside it called WebRole &lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0TiJ_6pOvNxn09GAKjk4DLchppn1cq2SsgWfMaBPWOsVNDNlAw3tm7eyLRTtVRt4JxUpH6DWteWbicWmMJegS1o5j41P4Afn-VjmbFvupjJljvb8WpUs8CDtYQkRXbfIbm7julwE849eS/s1600-h/image24.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;163&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjX3PH6guIz_ZunsnZoDbR_0C8CRFlr3XropSEHvaNQAVTXR3diyDR8qzNzd4IH712C5NT9BAEUthU0I035IVG4n88C1TXnO65A3EaSwuKQIwUcTxkcX5f6izqRJidZEThpHvIra0fuYHp0/?imgmax=800&quot; style=&quot;border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline;&quot; title=&quot;image&quot; width=&quot;431&quot; /&gt;&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;Open the WebRole project and create a new text file named &lt;strong&gt;HelloCloudService.csdef&lt;/strong&gt;.&amp;nbsp; Open the file using Notepad.&amp;nbsp; You can &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ee758711.aspx&quot; target=&quot;_blank&quot;&gt;read about the schema for the Service Definition file here&lt;/a&gt;. &lt;/li&gt;
&lt;li&gt;Add the following text to your .csdef file and press save: &lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: monospace; white-space: pre;&quot;&gt;&amp;lt;ServiceDefinition name=&quot;HelloCloudService&quot; &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;xmlns=&quot;http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition&quot;&amp;gt;
  &amp;lt;WebRole name=&quot;HelloCloudServiceWebRole&quot;&amp;gt;
    &amp;lt;InputEndpoints&amp;gt;
      &amp;lt;InputEndpoint name=&quot;HttpIn&quot; protocol=&quot;http&quot; port=&quot;80&quot; /&amp;gt;
    &amp;lt;/InputEndpoints&amp;gt;
  &amp;lt;/WebRole&amp;gt;
&amp;lt;/ServiceDefinition&amp;gt;&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;Open the Windows Azure SDK Command Prompt in elevated mode, type the following command, and press enter (you will have to change any paths to suit your file locations): &lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: monospace; white-space: pre;&quot;&gt;cspack &quot;D:\Sandboxes\2010Wave\HelloCloudService\WebRole\HelloCloudService.csdef&quot; &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;/role:HelloCloudServiceWebRole;&quot;D:\Sandboxes\2010Wave\HelloCloudService\HelloCloudService&quot; 
/generateConfigurationFile:&quot;D:\Sandboxes\2010Wave\HelloCloudService\HelloCloudServicePackage\HelloCloudService.cscfg&quot; 
/out:&quot;D:\Sandboxes\2010Wave\HelloCloudService\HelloCloudServicePackage&quot; 
/copyOnly&lt;/pre&gt;&lt;br /&gt;
Interesting things to take note of here are:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;We are generating a &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ee758710.aspx&quot; target=&quot;_blank&quot;&gt;Service Configuration&lt;/a&gt; file named HelloCloudService.cscfg and placing it within the deployment package folder.&amp;nbsp; This file is based on the Service Definition that we specified in step #3.&amp;nbsp; So had we declared any configuration items in that .csdef file, there would be stubs for their values in the Service Configuration file. &lt;/li&gt;
&lt;li&gt;By using the /copyOnly flag, all files are copied into a folder hierarchy whereas omitting this flag would produce a .cspkg formatted file that would be used as a deployment package for deploying to Windows Azure.&amp;nbsp; That’s what I showed in a &lt;a href=&quot;http://2010wave.blogspot.com/2010/01/how-to-build-azure-cloud-service.html&quot; target=&quot;_blank&quot;&gt;previous post on how to deploy into the cloud as part of your build process&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;At this point you should have created a CloudService package folder and you should find it positioned like so: &lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-laQ0efwVVIl9y4b83gNHkZNFtcQk3M-poz6WSNK9pHPhFfLhdZkFNHfTUdU4XeVuA20TsYhK_3AbruY9CcvOXt5LeJK0SYwwkgnlGqntskW_PbbJ5lTJ6Wh_3mFwQukeuXP0MQw0QLsN/s1600-h/image40.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;169&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCckoCtey_BoKO2MxGWHRqY4OcCel8rePaVsb7i0QTgaYkU-gCF0KZa01P5Gu6V_W9ssdAOZVvI43VNjYu8vmGy23hLcbaQs1iYLDs9C3B7zeFTa_sAuaFOy7w4dwyB43agtmZSuS_S_Hd/?imgmax=800&quot; style=&quot;border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline;&quot; title=&quot;image&quot; width=&quot;445&quot; /&gt;&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;Looking at the structure of that folder we see an elaborate hierarchy: &lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNMtk6oUHzzjrK7NF-S8dGbJ8ac_jDQ7kALbqPBFBbG3WKP7sMptxBqBhZmkQ-lKiYXfXIAAhoZ7TX8_Y4NgBiwGp22JaT6bstBI5P-gNv-sUEV-Ib7tkO0ZXML16FK8FPcu4Woik85gEL/s1600-h/image32.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;337&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0RMeFxaHHLYRqS2LLQtV7FEGwMZ1qpwL1H-DkKT_icd-LtiO6wOilJKwUAL9WAXK2NGXbxfZO3gUnGXugoRc5dHdKU-i9QwbyiejWybHqR4weHKuVdA8hqvZ8GzF3bZWjdnXVtNC4xjOn/?imgmax=800&quot; style=&quot;border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline;&quot; title=&quot;image&quot; width=&quot;271&quot; /&gt;&lt;/a&gt; &lt;/li&gt;
&lt;/ol&gt;&lt;strong&gt;Running the CloudService in the Development Fabric&lt;/strong&gt;&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;From the same elevated command prompt we can check to see the status of the Dev Fabric to see whether or not it is running: &lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrLf5YGaUAUY762cOCVqJ5xLeuu_miLNfGKrYGTIaZrhhsoqEv7vbM2l3MUbt_W2XllcvfYGoUwk2p-vZSICVaIW_X9XBxUdacWpZqx6q6YPJcOKHUOVKAjbIPBDLjLQIygPt8SHk7P22b/s1600-h/image44.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;85&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQQURZixLuY-ZFtc_HuUUcW-cHN0EbgqvZ4y-9qcIAc0syiu4zqRgEaMAFuR0oKBbxK07n1k2SNOHHeaNq1KbFQUrRQ05MZ8S7W7Dd_5Y9GGbvENHbqWKUmvFcelyyj1c61nRgcfRcq45r/?imgmax=800&quot; style=&quot;border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline;&quot; title=&quot;image&quot; width=&quot;432&quot; /&gt;&lt;/a&gt;&amp;nbsp; &lt;br /&gt;
You can &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/dd179412.aspx&quot; target=&quot;_blank&quot;&gt;find the reference documentation for CSRun.exe here&lt;/a&gt;. &lt;/li&gt;
&lt;li&gt;We can see in the above image my Devfabric service is not running… let’s start it by typing the following commands: &lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: monospace; white-space: pre;&quot;&gt;csrun /devfabric:start&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;At this point you should see the Devfabric service icon (&lt;em&gt;it’s the one which looks like a blue Windows flag&lt;/em&gt;) appear in your system tray icons &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNLOUi5FzVH0yjthACPRRwLolUIcpH3T5TSJ5nOvsvd3CrkQ_kG3-YwSBENF6onuyWqgPBlm3MQLMykWVSqHGuqeE8T6o8lIM-CGj4LappjF8Zyr7CI26gzMqRpvRHHdN1Jq3n59LY94Sj/s1600-h/image49.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;67&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRXd2la-1wapbFZZ-z2W7uBT6kzEw7zUusvwoRZQWCiQ33Ss4FIqBSKusM6g2y-QghPivAKf4Dsp-dxLOpbIZHcoVbJ4GN62sKsOgEekmD37WKnS6L_gvROZhCFjXLIQ-y2t37LMdczq6o/?imgmax=800&quot; style=&quot;border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline;&quot; title=&quot;image&quot; width=&quot;364&quot; /&gt;&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;Now we can launch our Service on the devfabric by calling /run and passing in the path to the location of our package and the configuration file that we generated using CSPack &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;csrun /run:&quot;D:\Sandboxes\2010Wave\HelloCloudService\HelloCloudServicePackage&quot;;
&quot;D:\Sandboxes\2010Wave\HelloCloudService\HelloCloudServicePackage\HelloCloudService.cscfg&quot; 
/launchbrowser&lt;/pre&gt;&lt;br /&gt;
&amp;nbsp;Things to pay attention to here are:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;We are specifying to pass in the Service Configuration file that we created previously as part of our packaging command &lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;After running that command, a browser window should appear with your web site hosted within it but now showing a message of “Welcome to the Cloud!”&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;If you right click on the Devfabric icon in your system tray and select Show UI you will also so that your service is now indeed being hosted in the Devfabric&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEja9I7UD84p7AHnXyH5eF7jO9zBwHLgadwBCLANy_pXqErRjAy4YwzEQveiyWELiwO_qUP7Jt6xIni19iVn7ucP8Jh48JszmoF0cwUFCpR4IdgRapzwYX7zZlhr7YtJ4XLk1D86Z6iTVPBq/s1600-h/image53.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;201&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYUWHBmwdUKNH_kQRH752VWhYBkhL4TzzvDfdxsoelTZM6A1MNEyTVp3MqGcJoBZnq7bi4aasQt-aPe4m69p-wfQqMJDUiB_Z5iuBZhTmAjT_BQEB3QxV5rEEGbnNRyltwaDpKVQjR6Pp8/?imgmax=800&quot; style=&quot;border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline;&quot; title=&quot;image&quot; width=&quot;541&quot; /&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;</content><link rel='replies' type='application/atom+xml' href='http://2010wave.blogspot.com/feeds/5037664135992738469/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://2010wave.blogspot.com/2010/01/creating-and-running-azure-package-by.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8879753012890807179/posts/default/5037664135992738469'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8879753012890807179/posts/default/5037664135992738469'/><link rel='alternate' type='text/html' href='http://2010wave.blogspot.com/2010/01/creating-and-running-azure-package-by.html' title='Creating and running an Azure package by hand'/><author><name>Darren Neimke</name><uri>http://www.blogger.com/profile/04138573191558270297</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://markitup.com/images/MyPicture_Small.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgq-Z2PuQPuH58lom5HlL1ZFrDQ1yTGtxbj3nHjIR2Th7GAopwVlZIQkXF2YEHjizqeBkBRVnp-fQmcED4WnMvRMXehBd2_AzIwgv_yhni2RDnUY0efbK7lwfZ8QalGV9h61cdYnuh0Nzxz/s72-c?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8879753012890807179.post-234040494101558908</id><published>2010-01-25T01:32:00.001-08:00</published><updated>2010-01-25T04:31:39.390-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Azure"/><category scheme="http://www.blogger.com/atom/ns#" term="Process"/><title type='text'>How to build an Azure Cloud Service package as part of your build process</title><content type='html'>I explained in &lt;a href=&quot;http://2010wave.blogspot.com/2010/01/how-to-build-sharepoint-wsp-packages-as.html&quot; target=&quot;_blank&quot;&gt;a previous blog entry&lt;/a&gt; how important, and ultimately simple, it is to create a deployment package for SharePoint as a part of your Continuous Integration process and in this post I’d like to show you how to produce deployment packages for Windows Azure.&amp;nbsp; This article is laid out in the following sections:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Deploying to Windows Azure&lt;/li&gt;
&lt;li&gt;The CSPack Command Line Tool&lt;/li&gt;
&lt;li&gt;Automating the Creation of your deployment package&lt;/li&gt;
&lt;/ul&gt;&lt;strong&gt;Deploying to Windows Azure&lt;/strong&gt;&lt;br /&gt;
Those of you who have deployed solutions to Windows Azure in the past will know the routine.&amp;nbsp; That is, you must:&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Create an account and then login to the Windows Azure portal (this is done through &lt;a href=&quot;http://azure.com/&quot;&gt;http://azure.com&lt;/a&gt; but for the purposes of this article I am going to use the tech preview site).&lt;/li&gt;
&lt;li&gt;Create a cloud service project for your account – in the following image I have 3 cloud services in my PDC08 CTP account:     &lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEga1TaUjhninLpFWGeQoMKaUXITPTYdClYFAMNGnhk2Wc-ZQUexRmRPvjFDyd6Afkkzepfi6BQwRu1SxMJE2hMrv66O7uPei-8sNjMI5oct2BahR7hhBReOKyNinJhn1LsR4C9ttXB71KLR/s1600-h/image%5B10%5D.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;266&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhumgMxnHRy_gzPb6wpYc9TE7rS_d4b4Sf6lS54luYh6S7kQasBzaOgBbQC28wG9hiUWr1zYDjWDbjkdISM6MASAaOYnWVC1OV3T9sCejBAg31bM8OnOAKGtBDqd1lzwmrEdjvQiVcMxosn/?imgmax=800&quot; style=&quot;border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline;&quot; title=&quot;image&quot; width=&quot;373&quot; /&gt;&lt;/a&gt;       &lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;Then click on a Cloud Service project to access the user interface to upload new deployments and toggle them between staging and production:     &lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqy0NRtfG6Cjbb73h0-23W75uuzv59sCuio2B8IkhzSPnwr8iAnJ5ps4LUjPsxuPypcCVfougcW24w1E7Zt6pLmVHoW6v4vOwZt65BYj1qBgYFYgOMX4-rjC_OpREy84QyJjkE4UcsOxZr/s1600-h/image%5B14%5D.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;324&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgcDirIjpo7LWclbH5GSTWiLB2v96p6MsA8sm-pqz5dISQLrBE_Fs12ZaFrR8NfVke5WVfWa-66M0NerMCpAiypdXCmiUlCSbdrhb6ORwx_scfJ77_9IHBvHMe0HUwQXe-g1g6YleQJbiei/?imgmax=800&quot; style=&quot;border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline;&quot; title=&quot;image&quot; width=&quot;443&quot; /&gt;&lt;/a&gt; &lt;/li&gt;
&lt;/ol&gt;The packages that you upload into the Cloud Service project is a Cloud Service Package format and is created by an Azure SDK tool called CSPack.exe.&amp;nbsp; These Cloud Service Packages have a .cspkg file extension and are also built into the Visual Studio tooling so that creation of these packages is all done seamlessly as part of using the Visual Studio tools.&amp;nbsp; As mentioned in &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/dd203059.aspx&quot; target=&quot;_blank&quot;&gt;this article&lt;/a&gt;, this is as simple as right-clicking on a VS project node and choosing the &lt;strong&gt;Publish&lt;/strong&gt; option.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;The CSPack Command Line Tool&lt;/strong&gt;&lt;br /&gt;
&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/dd179470.aspx&quot; target=&quot;_blank&quot;&gt;CSPack.exe&lt;/a&gt; is a tool which comes as part of the Windows Azure SDK and, when installed, it can be found at C:\Program Files\Windows Azure SDK\v1.0\bin\cspack.exe&lt;br /&gt;
&lt;blockquote&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvKl6JKo2xpefppE23R4uFPrOO-awVZg820wdVq5mjXg7hs3N9NQ0A1a_g-wCucv8UWR380MwJvhs97H9gRMMX4yNtmsK_94Gqnaz8C9tZXbt6xZtySXip24Am9uKDIMiV9vWiJlHBYpo_/s1600-h/image%5B3%5D.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;305&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgntEhQk0j2DqOazs-vg3e7WNnOZev0hzWrFy0UVu8diRStB5o6IEMD_gNsUTsHCEyTdJ2LYJgu-751vJD4MW8YWt4fMMU0Yp_IoEMNIYZWoZLgoo4J4L-hyRSJd9hyphenhyphenMeHl67odTlj03AGD/?imgmax=800&quot; style=&quot;border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline;&quot; title=&quot;image&quot; width=&quot;519&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/blockquote&gt;As per the documentation for CSPack, the syntax for using this tool to create a package is:&lt;br /&gt;
&lt;blockquote&gt;&lt;pre class=&quot;csharpcode&quot;&gt;CSPack &amp;lt;service-definition-file&amp;gt; [options]&lt;/pre&gt;&lt;/blockquote&gt;And the options that we are interested in are:&lt;br /&gt;
&lt;br /&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;0&quot; style=&quot;width: 815px;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt; &lt;td valign=&quot;top&quot; width=&quot;321&quot;&gt;&lt;strong&gt;Argument&lt;/strong&gt;&lt;br /&gt;
&lt;/td&gt;  &lt;td valign=&quot;top&quot; width=&quot;492&quot;&gt;&lt;strong&gt;Description&lt;/strong&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td valign=&quot;top&quot; width=&quot;321&quot;&gt;/out: &amp;lt;file | directory&amp;gt;&lt;br /&gt;
&lt;/td&gt;  &lt;td valign=&quot;top&quot; width=&quot;492&quot;&gt;This option indicates the output format and location for the role binaries.&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td valign=&quot;top&quot; width=&quot;321&quot;&gt;/role:&amp;lt;rolename&amp;gt;;&amp;lt;role-binaries-directory&amp;gt;; &lt;br /&gt;
&lt;/td&gt;  &lt;td valign=&quot;top&quot; width=&quot;492&quot;&gt;This option specifies the directory where the binaries for a role reside and the DLL where the entry point of the role is defined. The command line may include one /role option for each role in the service definition file.&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
And actual sample usage would look something like this:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;cspack \ServiceDefinition.csdef 
/role:AmbientPlacesWebRole;\CloudService.WebRole 
/out:AmbientPlaces.cspkg&lt;/pre&gt;&lt;br /&gt;
In this example you can see that we are passing in the path to the .csdef file which describes the definition of our service, including what configuration items that we are specifying.&amp;nbsp; Next we pass through the directories and names for each role that is specified in our Cloud Service Defnition (.csdef) file.&amp;nbsp; Finally we can optionally be explicit in specifying the name and location of our outputted Cloud Service Package (.cspkg).&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Automating the Creation of your deployment package&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
Building the solution as part of our automated build process is very similar to what we did when we created our SharePoint deployment package &lt;a href=&quot;http://2010wave.blogspot.com/2010/01/how-to-build-sharepoint-wsp-packages-as.html&quot; target=&quot;_blank&quot;&gt;my previous article on the topic&lt;/a&gt;:&lt;br /&gt;
&lt;blockquote&gt;&lt;br /&gt;
&lt;img alt=&quot;[SharePointBuildProcess[4].png]&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiszsM0O14Kjuyo8HyMfpENTvUz9ul3w60zwvj29TabM_odbL5syYK56XRY6YdjPFOri0o_Hd2tHTCF_RvQE2-GQWZFUhi3lTo4EqTvc8kvx54YFMbcSiwd47XjO9yIKSj4UWISuVonNa8U/s1600/SharePointBuildProcess%5B4%5D.png&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/blockquote&gt;Except that, instead of using WSPBuilder.exe, we would use CSPack.exe in those places.&lt;br /&gt;
&lt;br /&gt;
You can refer to my previous article to see how we did it for SharePoint packages, but for building Cloud Service packages I would refer you instead to the following blog post which does an excellent job of explaining on way to do the same thing from an MS Build script:&lt;br /&gt;
&lt;blockquote&gt;&lt;a href=&quot;http://blogs.msdn.com/domgreen/archive/2009/09/29/deploying-to-the-cloud-as-part-of-your-daily-build.aspx&quot;&gt;http://blogs.msdn.com/domgreen/archive/2009/09/29/deploying-to-the-cloud-as-part-of-your-daily-build.aspx&lt;/a&gt;&lt;br /&gt;
&lt;/blockquote&gt;Another option that is available is to use the Windows Azure PowerShell Cmdlets to customize your deployment process:&lt;br /&gt;
&lt;blockquote&gt;&lt;a href=&quot;http://blogs.msdn.com/chabrook/archive/2009/10/26/azure-powershell-cmdlets-announced.aspx&quot;&gt;http://blogs.msdn.com/chabrook/archive/2009/10/26/azure-powershell-cmdlets-announced.aspx&lt;/a&gt;&lt;br /&gt;
&lt;/blockquote&gt;</content><link rel='replies' type='application/atom+xml' href='http://2010wave.blogspot.com/feeds/234040494101558908/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://2010wave.blogspot.com/2010/01/how-to-build-azure-cloud-service.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8879753012890807179/posts/default/234040494101558908'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8879753012890807179/posts/default/234040494101558908'/><link rel='alternate' type='text/html' href='http://2010wave.blogspot.com/2010/01/how-to-build-azure-cloud-service.html' title='How to build an Azure Cloud Service package as part of your build process'/><author><name>Darren Neimke</name><uri>http://www.blogger.com/profile/04138573191558270297</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://markitup.com/images/MyPicture_Small.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhumgMxnHRy_gzPb6wpYc9TE7rS_d4b4Sf6lS54luYh6S7kQasBzaOgBbQC28wG9hiUWr1zYDjWDbjkdISM6MASAaOYnWVC1OV3T9sCejBAg31bM8OnOAKGtBDqd1lzwmrEdjvQiVcMxosn/s72-c?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8879753012890807179.post-706639051104576260</id><published>2010-01-21T15:09:00.001-08:00</published><updated>2010-01-21T15:12:24.850-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="MVP"/><title type='text'>Reflections on the Microsoft MVP Program</title><content type='html'>&lt;p&gt;Back in 2004 I was lucky enough to rewarded for a bunch of community activity that I’d been doing with my first MVP award.&amp;#160; At the time this meant a lot of forums activity on ASP Messageboard and the newer ASP.NET forums and I was also developing and managing quite a few open source software projects.&amp;#160; I’ve been re-awarded every year since then – up until this year that is.&amp;#160; For the last couple of years I’ve focused more and more on my management and hockey coaching skills and this has meant no time for “giving” to the community – unless a couple of thousand tweets per year counts &lt;img alt=&quot;Happy&quot; src=&quot;http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/1.gif&quot; /&gt; So now I am no longer an MVP for the first time in 6 years.&lt;/p&gt;  &lt;p&gt;I’ve reflected on the MVP program many times before but my opinion still has not swayed significantly from &lt;a href=&quot;http://markitup.com/Posts/Post.aspx?postId=f419d5e7-ab52-47de-9533-a10e2b0d9c3f&quot; target=&quot;_blank&quot;&gt;what I wrote here&lt;/a&gt; back in July 2006 – and yes giving up the MSDN subscription is going to have a pretty hard impact I expect.&amp;#160; I also agree strongly with what &lt;a href=&quot;http://twitter.com/davidlem&quot; target=&quot;_blank&quot;&gt;@davidlem&lt;/a&gt; wrote back in &lt;a href=&quot;http://blogs.msdn.com/davidlem/archive/2006/01/20/515165.aspx&quot; target=&quot;_blank&quot;&gt;his post&lt;/a&gt; back in January of that same year.&lt;/p&gt;  &lt;p&gt;During my time as an MVP I was lucky enough to work for employers who supported me and this allowed me to travel to Seattle on several occasions to attend MVP Summits.&amp;#160; And &lt;a href=&quot;http://weblogs.asp.net/asmith/archive/2004/04/09/110687.aspx&quot; target=&quot;_blank&quot;&gt;I have great memories of those&lt;/a&gt;!&amp;#160; Meeting with real Redmondites and making a personal connection with so many of them has really helped me in my career and made it fun along the way too. Justin Rogers, Doug Seven, Kent Sharkey, Duncan MacKenzie, Jonathon DeHalleux… the list goes on.&amp;#160; Meeting and getting to talk with people such as Anders Heilberg, Paul Vick, and Don Box and being able to attend keynotes delivered by both Steve Ballmer and Bill Gates were standout highlights.&amp;#160; Of course meeting and making relationships with community leaders (and there are too many for me to start naming them) was also an enriching experience.&lt;/p&gt;  &lt;p&gt;So if you are an MVP now, my advice is to use the program as a tool and take the opportunity to attend these conferences because they are truly unique opportunities and you won’t regret it.&amp;#160; And while there, go out of your way to say “hi” to people.&amp;#160; Get to know some of them.&amp;#160; Read their blogs, chat with them, have a beer with them.&lt;/p&gt;  &lt;p&gt;There are changes that I think could be made to improve the program but they are largely encapsulated in the previous blog posts that I linked to.&amp;#160; Given the chance to make any single change, probably upping the churn factor would be the thing that I’d like to see.&amp;#160; To give more people opportunity and to force others to cherish their moments in the program while they have them – to take advantage of that time.&lt;/p&gt;  &lt;p&gt;So where to now?&amp;#160; Who knows… I’m yet to fully decide how much time to take from business and sporting interests to channel back into technical community activity.&amp;#160; I’d love to, but you’ve got to do things that make you happy for the right reasons.&amp;#160; But I am grateful for what I’ve had and I’d love to personally thank all those who have supported me over that time.&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://2010wave.blogspot.com/feeds/706639051104576260/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://2010wave.blogspot.com/2010/01/reflections-on-microsoft-mvp-program.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8879753012890807179/posts/default/706639051104576260'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8879753012890807179/posts/default/706639051104576260'/><link rel='alternate' type='text/html' href='http://2010wave.blogspot.com/2010/01/reflections-on-microsoft-mvp-program.html' title='Reflections on the Microsoft MVP Program'/><author><name>Darren Neimke</name><uri>http://www.blogger.com/profile/04138573191558270297</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://markitup.com/images/MyPicture_Small.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8879753012890807179.post-2232567961284037493</id><published>2010-01-20T02:48:00.001-08:00</published><updated>2010-01-20T02:52:26.210-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="jQuery"/><category scheme="http://www.blogger.com/atom/ns#" term="SharePoint"/><title type='text'>How to reference the jQuery libraries from within your SharePoint environment</title><content type='html'>If you’ve decided that you want to implement a modern client-centric approach to your SharePoint page customizations you may well decide to use jQuery as a major ingredient.&amp;nbsp; If you do then you will need to decide how to reference the jQuery library scripts from within your pages.&amp;nbsp; In this article I will show you how to use the AdditionalPageHead delegate control to implement an elegant approach to solving this puzzle.&lt;br /&gt;
&lt;br /&gt;
SharePoint 2007 provides us with a very elegant way to insert items into the head section of our HTML pages. These insertions might typically be referencing additional CSS or JavaScript resources. The mechanism that is provided by SharePoint is a &lt;a href=&quot;http://www.devx.com/enterprise/Article/36628&quot;&gt;DelegateControl&lt;/a&gt; with an ID of AdditionalPageHead. The cool fact about the AdditionalPageHead delegate control is that it allows multiple controls to be injected into it!&lt;br /&gt;
You can read the following articles to see examples of using the AdditionalPageHead delegate control to perform these types of common tasks:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;http://weblogs.asp.net/jan/archive/2008/11/20/sharepoint-2007-and-jquery-1.aspx&quot;&gt;Integrating SharePoint 2007 and jQuery&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.mtelligent.com/journal/2008/1/11/using-the-delegate-control-to-add-meta-tags-to-sharepoint-pa.html&quot;&gt;Using the Delegate Control to Add Meta Tags to SharePoint Pages&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;A good scenario for thinking about using this type of approach might be if you are developing a WebPart which makes use of jQuery. In this case you will want to deploy your custom WebPart as a feature and have all of the resources packaged correctly so that everything comes together at runtime. These resources include:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;The jQuery library JavaScript files &lt;/li&gt;
&lt;li&gt;Your WebPart class &lt;/li&gt;
&lt;li&gt;JavaScript behaviours for your WebPart &lt;/li&gt;
&lt;li&gt;CSS styles for your WebPart &lt;/li&gt;
&lt;/ul&gt;You would separate out the resources that are specific to your web part from the jQuery library which should form part of the common infrastructure of your page so that other features can reference it. So we would create 2 features and deploy them separately:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;CommonPageHeadInfrastructure - A feature that includes a custom web control which writes common JavaScript and CSS references into the page head region and a Feature definition which injects the custom control into the AdditionalPageHead delegate control. &lt;/li&gt;
&lt;li&gt;CustomWebPartFeature - A feature which encapsulates the functionality of your custom web part. &lt;/li&gt;
&lt;/ul&gt;The web control that you create to write out your common JS and CSS references is a simple control which inherits from Control and writes out the references from within its Render method like so:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;public class PageHeadContentControl : Control
{
    protected override void Render(System.Web.UI.HtmlTextWriter writer)
    {
        writer.Write(&quot;&amp;lt;script type=&quot;text/javascript&quot; src=&quot;/_layouts/1033/jquery-1.2.6.min.js&quot;&amp;gt;&amp;lt;/script&amp;gt;&quot;) ;
    }
} &lt;/pre&gt;&lt;br /&gt;
And you would deploy that control into the delegate control using a technique similar to what is shown in &lt;a href=&quot;http://www.mtelligent.com/journal/2008/1/11/using-the-delegate-control-to-add-meta-tags-to-sharepoint-pa.html&quot;&gt;this article&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
As for your custom web part, you would create it as you normally would and, when creating your Child Controls, register your scripts in the typical manner with the ScriptManager like so:As for your custom web part, you would create it as you normally would and, when creating your Child Controls, register your scripts in the typical manner with the ScriptManager like so:&quot;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;var scriptPath = &quot;/_layouts/1033/YourFeatureName/YourScriptFileName.js&quot;;
var scriptKey = &quot;YourFeatureNameScriptIncludeKey&quot; ;

var type = this.GetType() ;
var cs = Page.ClientScript;

if (!cs.IsClientScriptIncludeRegistered(type, scriptKey))
{
    cs.RegisterClientScriptInclude(cstype, scriptKey, scriptPath);
}  &lt;/pre&gt;&lt;br /&gt;
Of course this means that you must deploy the YourScriptFileName.js file as part of your feature. You can learn about the structure for doing that by reading &lt;a href=&quot;http://2010wave.blogspot.com/2010/01/how-to-build-sharepoint-wsp-packages-as.html&quot;&gt;this article&lt;/a&gt;.</content><link rel='replies' type='application/atom+xml' href='http://2010wave.blogspot.com/feeds/2232567961284037493/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://2010wave.blogspot.com/2010/01/how-to-reference-jquery-libraries-from.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8879753012890807179/posts/default/2232567961284037493'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8879753012890807179/posts/default/2232567961284037493'/><link rel='alternate' type='text/html' href='http://2010wave.blogspot.com/2010/01/how-to-reference-jquery-libraries-from.html' title='How to reference the jQuery libraries from within your SharePoint environment'/><author><name>Darren Neimke</name><uri>http://www.blogger.com/profile/04138573191558270297</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://markitup.com/images/MyPicture_Small.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8879753012890807179.post-2777051027139971752</id><published>2010-01-19T20:26:00.000-08:00</published><updated>2010-01-19T20:26:43.608-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="learning"/><title type='text'>The difference between a great developer and an average one is 6 hours</title><content type='html'>I explained in &lt;a href=&quot;http://2010wave.blogspot.com/2009/12/2010wave-intro-post.html&quot;&gt;my intro post&lt;/a&gt; that I was using this blog to immerse myself in the new wave of technologies. &amp;nbsp;In this article I want to shed some more light on what the primary driver behind this was.&lt;br /&gt;
&lt;br /&gt;
Until a couple of years ago I was very comfortable with the &lt;i&gt;current &lt;/i&gt;.NET technologies of the day - ASP.NET 2.0, ASP.NET Ajax, WinForms... and a bunch of tools and libraries that shipped within that ecosystem. &amp;nbsp;I would probably go so far as to put myself out as being an &lt;i&gt;expert &lt;/i&gt;(whatever that means) at using them to build stuff. &amp;nbsp;Then one by one, new components shipped and I somehow stopped staying at the leading edge of the curve - .NET 3, .NET 4, Silverlight, WPF, and a bunch of agile practices that came with them. &amp;nbsp;The way we build stuff changed too and so new arts and disciplines came to support that - PowerShell, TDD, DI, MS Build and the list goes on.&lt;br /&gt;
&lt;br /&gt;
Let&#39;s just say that, during that period, when given a choice between sleeping and staying ahead of the curve... I chose to sleep.&lt;br /&gt;
&lt;br /&gt;
The most important result of all that was not that I cannot use these new technologies, it&#39;s more about the level of comfort that I have with them. &amp;nbsp;Probably the thing that I liked best about what I had before was the ability that I had to create a high quality &lt;b&gt;base application&lt;/b&gt; in a very short space of time. &lt;br /&gt;
&lt;br /&gt;
This meant that I could fire up Visual Studio, create a blank solution, and in under 6 hours I could have something which:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Was housed in a source control system&lt;/li&gt;
&lt;li&gt;Could successfully build as part of a CI process&lt;/li&gt;
&lt;li&gt;Used best practices for &lt;a href=&quot;http://en.wikipedia.org/wiki/Cross-cutting_concern&quot;&gt;cross cutting concerns&lt;/a&gt; such as configuration, logging and security&lt;/li&gt;
&lt;li&gt;Used high quality third party libraries where they were needed to add value&lt;/li&gt;
&lt;li&gt;Had a good consistent approach to naming and design guidelines for things such as namespaces and classes&lt;/li&gt;
&lt;/ul&gt;&lt;div&gt;So in under 6 hours, I had an architecture that I was very comfortable with; I knew that I could extend it, deploy it, customize it, and generally do what I liked with it.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;At the time I remember lamenting how long it would take other developers to get to a good, consistent base such as this. &amp;nbsp;You might assign a developer a task and when you came back a week or two later they hardly had anything resembling something which had evolved from anything resembling modern software.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Getting to your high quality base should be the sharpest tool in your toolkit. &amp;nbsp;And until you can get to that point, it should be the main focus for your &lt;a href=&quot;http://codekata.pragprog.com/&quot;&gt;Coding Katas&lt;/a&gt;. &amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;So that&#39;s the aim for me this year and that&#39;s the journey that I hope that this blog will document. &amp;nbsp;Base app, best practices, 6 hours!&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://2010wave.blogspot.com/feeds/2777051027139971752/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://2010wave.blogspot.com/2010/01/difference-between-great-developer-and_19.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8879753012890807179/posts/default/2777051027139971752'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8879753012890807179/posts/default/2777051027139971752'/><link rel='alternate' type='text/html' href='http://2010wave.blogspot.com/2010/01/difference-between-great-developer-and_19.html' title='The difference between a great developer and an average one is 6 hours'/><author><name>Darren Neimke</name><uri>http://www.blogger.com/profile/04138573191558270297</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://markitup.com/images/MyPicture_Small.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8879753012890807179.post-326875399903293866</id><published>2010-01-18T16:54:00.001-08:00</published><updated>2010-01-24T17:55:27.074-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Process"/><category scheme="http://www.blogger.com/atom/ns#" term="SharePoint"/><title type='text'>How to build a SharePoint WSP package as part of your Continuous Integration process</title><content type='html'>Having a continuous, repeatable, and automated build process is necessary when developing software - and developing custom solutions for SharePoint is no exception. In this article I will describe how to automate the creation of SharePoint WSP Solution files as part of your continuous integration build process. The article is laid out in the following sections:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;SharePoint Features and Solutions &lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.codeplex.com/wspbuilder&quot;&gt;WSP Builder&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;Automating the Creation of your WSP Solution &lt;/li&gt;
&lt;/ul&gt;If you are familiar and comfortable with SharePoint features and solutions, feel free to skip forward past the first two sections.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;SharePoint Features and Solutions&lt;/strong&gt;&lt;br /&gt;
The way that you develop for SharePoint is via Features. SharePoint Features are a collection of resources and XML configuration information which describes to SharePoint how a certain feature is structured. To provide a concrete example, take a look at the following link to see what goes into creating a Feature:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://sharepointsolutions.blogspot.com/2006/10/anatomy-of-sharepoint-wss-v3-feature.html&quot;&gt;Anatomy of a SharePoint WSS v3 Feature Project in Visual Studio 2005&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
That&#39;s a fair bit of stuff! At a minimum you are typically looking at:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;A Feature.xml file which defines the Feature and specifies the location of assemblies, files, dependencies, or properties that support the Feature. &lt;/li&gt;
&lt;li&gt;A signed assembly to be installed in the GAC. &lt;/li&gt;
&lt;li&gt;An Elements.xml configuration file which defines the elements that the Feature depends upon &lt;/li&gt;
&lt;/ul&gt;In that article there is also a lot of fluff that is required to create a SharePoint Solution - which is what you need to create to actually deploy and install your Feature into SharePoint. The items that are created in that article which exist solely to create the SharePoint Solution are:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;A Manifest.xml file to describe how to package the Solution &lt;/li&gt;
&lt;li&gt;A DDF file which defines the structure and contents of the solution package &lt;/li&gt;
&lt;li&gt;A custom MSBuild task which runs makecab to process the DDF file and create the .wsp Solution file. &lt;/li&gt;
&lt;/ul&gt;&lt;strong&gt;WSPBuilder&lt;/strong&gt;&lt;br /&gt;
WSPBuilder is an open source piece of software which really helps to simplify the task of creating SharePoint Features and Solutions. WSPBuilder consists of an executable program and a Visual Studio plug-in which aid developers when developing SharePoint Features. Here&#39;s a link to a page with a tonne of links to useful articles which explain WSPBuilder:&lt;br /&gt;
&lt;blockquote&gt;&lt;a href=&quot;http://keutmann.blogspot.com/2009/04/wspbuilder-documentation.html&quot;&gt;WSPBuilder documentation&lt;/a&gt;&lt;br /&gt;
&lt;/blockquote&gt;When using WSPBuilder you do not need to know about the second grouping of objects that were created in the article which I referenced earlier. Namely, you will not need to create a Manifest.xml, a DDF file, or the custom MSBuild task to call makecab.exe.&lt;br /&gt;
&lt;br /&gt;
When using the WSPBuilder Visual Studio add-in, developers get &quot;right-click&quot; &amp;gt; &quot;add feature&quot; functionality which really does help to bootstrap the development of Features. Not only that, WSPBuilder also helps by simplifying the following common tasks:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Deploying to the GAC &lt;/li&gt;
&lt;li&gt;Creating Features &lt;/li&gt;
&lt;li&gt;Generating SharePoint Solutions &lt;/li&gt;
&lt;li&gt;Debugging &lt;/li&gt;
&lt;/ul&gt;Each of these features can be accessed from within Visual Studio to help speed up the development process when developing SharePoint Features. The interesting part of this is that these services are actually provided by the underlying WSPBuilder.exe application. And this means that we can use this executable during our build to automatically generate SharePoint .wsp solution files as part of our continuous integration process.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Automating the Creation of your WSP Solution&lt;/strong&gt;&lt;br /&gt;
Having used WSPBuilder, your Visual Studio will have a specific structure that conforms to how SharePoint is laid out in the 12 Root, GAC, and 80 Folder. And using the VS add-ins, your developers will have been able to easily create and deploy WSPs on their local development environments. Here is a view of the layout that I would use for a typical SharePoint development project:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhepBSvc-dEfRDddxI5xdSQhZLudkFysQcIghZcmk4C3ZY-PXfVNGkQf7ijduXgLGFVWGOGGaTBOIgjsbferwNeiyrbD-N59ZizFY0PCsyLXFykkM-fJEyZzQDZzBQa4fUgYYwQdqQxHjXS/s1600-h/ProjectStructure%5B4%5D.png&quot;&gt;&lt;img alt=&quot;ProjectStructure&quot; border=&quot;0&quot; height=&quot;438&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiS7joTjbLzODpwU3tC1GYtyeLmauSOFn3wRSMzE4rCV4RuF4e-CjLs52wYvbbaCghnTN8bf0mPgSddDTPDF5W2A02OUlR9j8m8DjYVuUnJyjkQbImfPRZgpsymXhmD8ikAwrq5jCWZTgpG/?imgmax=800&quot; style=&quot;border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline;&quot; title=&quot;ProjectStructure&quot; width=&quot;548&quot; /&gt;&lt;/a&gt; &lt;br /&gt;
&lt;br /&gt;
When developing I can simply right click the My.SharePoint.FrontEnd project to get WSPBuilder options for deploying, debugging, or re-deploying assemblies to the GAC. However, in order to maintain order and control over the content of WSP files and have them versioned properly, it is best to generate the WSP files that will get pushed through into production automatically as part of your build process.&lt;br /&gt;
&lt;br /&gt;
Creating a WSP package from your build process simply means that you will invoke WSPBuilder.exe as part of your CI build. Therefore the first thing that you must do is to ensure that you have access to &lt;a href=&quot;http://www.codeplex.com/wspbuilder&quot;&gt;WSPBuilder&lt;/a&gt; on your build server.&lt;br /&gt;
&lt;br /&gt;
Once you have WSPBuilder on the build server it is a matter of adding some control flow to your build tasks so that it gets called after the Visual Studio project has been built. The control flow for your continuous build process should look similar to this:Creating a WSP package from your build process simply means that you will invoke WSPBuilder.exe as part of your CI build. Therefore the first thing that you must do is to ensure that you have access to WSPBuilder on your build server. Once you have WSPBuilder on the build server it is a matter of adding some control flow to your build tasks so that it gets called after the Visual Studio project has been built. The control flow for your continuous build process should look similar to this:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiszsM0O14Kjuyo8HyMfpENTvUz9ul3w60zwvj29TabM_odbL5syYK56XRY6YdjPFOri0o_Hd2tHTCF_RvQE2-GQWZFUhi3lTo4EqTvc8kvx54YFMbcSiwd47XjO9yIKSj4UWISuVonNa8U/s1600-h/SharePointBuildProcess%5B4%5D.png&quot;&gt;&lt;img alt=&quot;SharePointBuildProcess&quot; border=&quot;0&quot; height=&quot;433&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFX7GgU8dJxumYzTWZYdvT55NAqAbPrNqhn8GUE9gfbouxiwClTGTNIVAt7y9gbcWlI9QzibwIQNgtp-HiML_ZcBScWlyybsO8zunEChYiZJ7HXa1rHLqj8qAW5uztkPjl5W5gWdCA4lNH/?imgmax=800&quot; style=&quot;border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline;&quot; title=&quot;SharePointBuildProcess&quot; width=&quot;584&quot; /&gt;&lt;/a&gt; &lt;br /&gt;
&lt;br /&gt;
In my case I am using MS Build to control the flow of the build process, but you could just as easily use NAnt or whatever build scripts you typically use to build your solutions.&lt;br /&gt;
&lt;br /&gt;
Running through the MS Build script logic we see that, at the head of the MSBuild file, I would usually add some properties to provide runtime pointers to where MS Build can find various locations.Running through the MS Build script logic we see that, at the head of the MSBuild file, I would usually add some properties to provide runtime pointers to where MS Build can find various locations.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;&amp;lt;PropertyGroup&amp;gt;
&amp;lt;Root&amp;gt;$(MSBuildStartupDirectory)&amp;lt;/Root&amp;gt;
&amp;lt;WSPBuilderPath&amp;gt;c:\Program Files (x86)\WSPTools\WSPBuilderExtensions&amp;lt;/WSPBuilderPath&amp;gt;
&amp;lt;WSPSolutionPath&amp;gt;$(Root)\$(build_branch_name)\MySharePointProject\My.SharePoint.FrontEnd&amp;lt;/WSPSolutionPath&amp;gt;
&amp;lt;/PropertyGroup&amp;gt; &lt;/pre&gt;&lt;br /&gt;
In the above snippet I have a property which points to the path of the WSPBuilder executable and another one (WSPSolutionPath) that points to the root path of the the Visual Studio project which has my features in it (typically I have 2 projects in my solution: 1 which has the code assembly and one which only has the feature definitions).&lt;br /&gt;
&lt;br /&gt;
Notice that the WSPSolutionPath is composed by a variable which is passed into my build - $(build_branch_name) - from my continuous integration process. You can hard code this part of the path if you do not need the branch path to be dynamic.&lt;br /&gt;
&lt;br /&gt;
Next up the I use an MS Build task to compile the solution. This builds the assembly which contains the code for WebParts, Workflows, FeatureReceivers, etc and which will ultimately reside in the GACNotice that the WSPSolutionPath is composed by a variable which is passed into my build - $(build_branch_name) - from my continuous integration process. You can hard code this part of the path if you do not need the branch path to be dynamic. Next up the I use an MSBuild task to compile the solution. This builds the assembly which contains the code for WebParts, Workflows, FeatureReceivers, etc and which will ultimately reside in the GAC.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;&amp;lt;ItemGroup&amp;gt;
&amp;lt;ProjectToBuild Include=&quot;$(Root)\$(build_branch_name)\MySharePointProject\My.SharePoint.sln&quot; /&amp;gt;
&amp;lt;/ItemGroup&amp;gt;

&amp;lt;MSBuild
Projects=&quot;@(ProjectToBuild)&quot;
Targets=&quot;Build&quot;&amp;gt;

&amp;lt;Output
TaskParameter=&quot;TargetOutputs&quot;
ItemName=&quot;AssembliesBuiltByChildProjects&quot;
/&amp;gt;
&amp;lt;/MSBuild&amp;gt; &lt;/pre&gt;&lt;br /&gt;
Once the solution has been built, I am able to run WSPBuilder to create a WSP package from the compiled artifacts.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;&amp;lt;Exec Command=&#39;&quot;$(WSPBuilderPath)\WSPBuilder.exe&quot;
-SolutionPath &quot;$(WSPSolutionPath)&quot;
-12Path &quot;$(WSPSolutionPath)\12&quot;
-GACPath &quot;$(WSPSolutionPath)\GAC&quot;&#39;
ContinueOnError=&#39;false&#39; 
/&amp;gt; &lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
Notice that the GACPath argument expects any assmblies to be in a GAC folder of the feature project, I used a post-build script in my Core assembly project to copy the assembly across to this folder in my feature project:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;xcopy &quot;$(OutputDir)*.dll&quot; &quot;$(SolutionDir)My.SharePoint.FrontEnd\GAC\&quot; /Y /R &lt;/pre&gt;&lt;br /&gt;
The final thing to do is to publish the WSP package to a release server so that it can be deployed into acceptance and production environments…&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;&amp;lt;MakeDir Directories=&quot;$(deploy_path)\$(build_number)&quot; Condition=&quot;!Exists(&#39;$(deploy_path)\$(build_number)&#39;)&quot; /&amp;gt;

&amp;lt;ItemGroup&amp;gt;
&amp;lt;WSPSourceFiles Include=&quot;$(MSBuildProjectDirectory)\My.SharePoint.FrontEnd.wsp; $(WSPSolutionPath)\Deploy\*&quot; /&amp;gt;
&amp;lt;/ItemGroup&amp;gt;

&amp;lt;Copy
SourceFiles=&quot;@(WSPSourceFiles)&quot;
DestinationFolder=&quot;$(deploy_path)\$(build_number)&quot;
/&amp;gt; &lt;/pre&gt;&lt;br /&gt;
As you can see, this is simply a matter of creating a folder and copying the resultant WSP file across.&amp;nbsp; Importantly you will note that when I create the release folder that I include the build number as part of the path.&amp;nbsp; This practice makes it very easy to keep your versioning aligned between source code, release notes, and deployable artifacts.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Updates&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;a href=&quot;http://twitter.com/jthake&quot;&gt;Jeremy Thake&lt;/a&gt; has uploaded a great screencast which shows how to do this (and more) using TFS which you can &lt;a href=&quot;http://www.screencast.com/users/jthake/folders/SharePointDevWiki.com%20Screencast/media/d78a1755-6c07-4256-8a96-84b82d23c3ef&quot;&gt;view here&lt;/a&gt;.</content><link rel='replies' type='application/atom+xml' href='http://2010wave.blogspot.com/feeds/326875399903293866/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://2010wave.blogspot.com/2010/01/how-to-build-sharepoint-wsp-packages-as.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8879753012890807179/posts/default/326875399903293866'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8879753012890807179/posts/default/326875399903293866'/><link rel='alternate' type='text/html' href='http://2010wave.blogspot.com/2010/01/how-to-build-sharepoint-wsp-packages-as.html' title='How to build a SharePoint WSP package as part of your Continuous Integration process'/><author><name>Darren Neimke</name><uri>http://www.blogger.com/profile/04138573191558270297</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://markitup.com/images/MyPicture_Small.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiS7joTjbLzODpwU3tC1GYtyeLmauSOFn3wRSMzE4rCV4RuF4e-CjLs52wYvbbaCghnTN8bf0mPgSddDTPDF5W2A02OUlR9j8m8DjYVuUnJyjkQbImfPRZgpsymXhmD8ikAwrq5jCWZTgpG/s72-c?imgmax=800" height="72" width="72"/><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8879753012890807179.post-6052837540964388149</id><published>2010-01-18T05:01:00.001-08:00</published><updated>2010-02-01T01:40:22.795-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Media"/><category scheme="http://www.blogger.com/atom/ns#" term="Silverlight"/><category scheme="http://www.blogger.com/atom/ns#" term="Video"/><title type='text'>How to fix a “clip duration” error when using the Expression Encoder SDK</title><content type='html'>Tonight I was playing around with the latest &lt;a href=&quot;http://blogs.msdn.com/expressionencoder/archive/2009/07/29/9853000.aspx&quot; target=&quot;_blank&quot;&gt;Expression Encoder SDK&lt;/a&gt; in an attempt to build a small video editing tool.&amp;nbsp; What I wanted to do was to take a video and then extract only the highlights from it into a smaller “highlights video”.&amp;nbsp; This is really useful for my side interest as a hockey coach because it would enable me to extract only certain highlights from a hockey match and then send the reduced video around to the players to watch.&lt;br /&gt;
So I wrote the following code to get things started:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;MediaItem mediaItem = new MediaItem(@&quot;D:\Videos\CANON\20090202\20090202000204.m2ts&quot;);

mediaItem.Sources[0].Clips.Add(new Clip(TimeSpan.FromSeconds(49), TimeSpan.FromSeconds(56)));
mediaItem.Sources[0].Clips.Add(new Clip(TimeSpan.FromSeconds(159), TimeSpan.FromSeconds(167)));
mediaItem.Sources[0].Clips.Add(new Clip(TimeSpan.FromSeconds(290), TimeSpan.FromSeconds(297)));

Job job = new Job();
job.MediaItems.Add(mediaItem);

job.OutputDirectory = @&quot;C:\output&quot;;
job.Encode();&lt;/pre&gt;&lt;br /&gt;
&lt;style type=&quot;text/css&quot;&gt;
.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, &quot;Courier New&quot;, 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; }
&lt;/style&gt;&lt;br /&gt;
When I ran it the following exception was thrown:&lt;br /&gt;
&lt;blockquote&gt;&lt;strong&gt;EncodeErrorException was unhandled&lt;/strong&gt; &lt;br /&gt;
A clip&#39;s duration is smaller then the min clip duration 00:00:00.0170000.&lt;/blockquote&gt;Now if you look at the timings that I entered for each of the Clips in the media’s ClipCollection you will clearly see that they are indeed each greater than the duration shown in the error message, so what gives!?&lt;br /&gt;
&lt;br /&gt;
The fix turned out to be quite simple – and obvious really – but I thought that I’d post the solution because there weren’t any clean hits that came up when I did my own search on the error message.&amp;nbsp; To fix, you simple call Clear() on the ClipCollection before you start adding your own Clip’s to it like so:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;MediaItem mediaItem = new MediaItem(@&quot;D:\Videos\CANON\20090202\20090202000204.m2ts&quot;);
mediaItem.Sources[0].Clips.Clear();

...

Job job = new Job();
job.MediaItems.Add(mediaItem);

job.OutputDirectory = @&quot;C:\output&quot;;
job.Encode();&lt;/pre&gt;&lt;br /&gt;
&lt;style type=&quot;text/css&quot;&gt;
.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, &quot;Courier New&quot;, 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; }
&lt;/style&gt;</content><link rel='replies' type='application/atom+xml' href='http://2010wave.blogspot.com/feeds/6052837540964388149/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://2010wave.blogspot.com/2010/01/how-to-fix-clip-duration-error-when.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8879753012890807179/posts/default/6052837540964388149'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8879753012890807179/posts/default/6052837540964388149'/><link rel='alternate' type='text/html' href='http://2010wave.blogspot.com/2010/01/how-to-fix-clip-duration-error-when.html' title='How to fix a “clip duration” error when using the Expression Encoder SDK'/><author><name>Darren Neimke</name><uri>http://www.blogger.com/profile/04138573191558270297</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://markitup.com/images/MyPicture_Small.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8879753012890807179.post-328237890911883864</id><published>2010-01-12T13:58:00.000-08:00</published><updated>2010-01-12T20:10:21.394-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Google Wave"/><title type='text'>WaveBot integration with Blog Posts</title><content type='html'>&lt;div&gt;I&#39;m using this page to try out the blogbot@appspot.com Wave bot. &amp;nbsp;Using that bot, you can embed your Google Wave&#39;s into public web pages. &amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;&lt;span style=&quot;background-color: yellow;&quot;&gt;&lt;b&gt;If you have a Wave account, you should see an embedded Wave below.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
My initial impressions on embedded Waves is that, whilst they are an interesting idea, currently the limited feature-set of Wave means that you might as well simply direct people to your Wave via its public URL. &amp;nbsp;The reasons for this thinking are that:&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Your Waves have to be public to ensure that visitors can see the content - and without the ability to assign roles to participants of a Wave, this means that everybody will have contributor access.&lt;/li&gt;
&lt;li&gt;There is no ability to have draft and published versions of content. &amp;nbsp;So if all of the content that you are sharing is &quot;published&quot;, what&#39;s the benefit of pushing it through to your blog? &amp;nbsp;You might as well use the in-built content publishing features of your blog software.&amp;nbsp;&lt;/li&gt;
&lt;/ol&gt;&lt;div&gt;Positive aspects to using Google Wave as a &quot;multimedia wikichat&quot; content source are:&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;ol&gt;&lt;li&gt;Google Wave has a kick-ass strength in content versioning, providing users with the ability to replay the evolution of content.&lt;/li&gt;
&lt;li&gt;It allows you to embed rich content into your content. &amp;nbsp;This includes the ability to embed &lt;a href=&quot;http://completewaveguide.com/guide/Wave_Gadgets&quot;&gt;Wave Gadgets&lt;/a&gt;&amp;nbsp;so that you could include things such as charts or surveys as well as the ability to use &lt;a href=&quot;http://completewaveguide.com/guide/Wave_Bots&quot;&gt;Wave Bots&lt;/a&gt;&amp;nbsp;that you could include to automate repetitive tasks or to augment content by providing additional services - such as Dictionary and Thesaurus services for example.&amp;nbsp;&lt;/li&gt;
&lt;/ol&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;b&gt;Further reading:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;http://completewaveguide.com/guide/Dive_Deeper_into_Wave#Make_a_Wave_Public&quot;&gt;How to make your Waves public&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://completewaveguide.com/guide/Wave_Bots&quot;&gt;Wave bots&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;hr /&gt;&lt;br /&gt;
&lt;div id=&quot;wave&quot; style=&quot;height: 420px; width: 90%;&quot;&gt;&lt;/div&gt;&lt;br /&gt;
&lt;script src=&quot;http://wave-api.appspot.com/public/embed.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;&lt;br /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
  var wave =
    new WavePanel(&#39;https://wave.google.com/wave/&#39;);
  wave.setUIConfig(&#39;white&#39;, &#39;black&#39;, &#39;Arial&#39;, &#39;13px&#39;);
  wave.loadWave(&#39;googlewave.com!w+q9sM7Jc_A&#39;);
  wave.init(document.getElementById(&#39;wave&#39;));
&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://2010wave.blogspot.com/feeds/328237890911883864/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://2010wave.blogspot.com/2010/01/kindle-thoughts.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8879753012890807179/posts/default/328237890911883864'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8879753012890807179/posts/default/328237890911883864'/><link rel='alternate' type='text/html' href='http://2010wave.blogspot.com/2010/01/kindle-thoughts.html' title='WaveBot integration with Blog Posts'/><author><name>Darren Neimke</name><uri>http://www.blogger.com/profile/04138573191558270297</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://markitup.com/images/MyPicture_Small.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8879753012890807179.post-4977931972200324252</id><published>2010-01-06T03:28:00.001-08:00</published><updated>2010-01-06T03:31:28.386-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Drag and Drop"/><category scheme="http://www.blogger.com/atom/ns#" term="Silverlight"/><title type='text'>Using Drag and Drop in a Silverlight 4 Application</title><content type='html'>&lt;p&gt;Today I was working through the excellent &lt;a href=&quot;http://channel9.msdn.com/learn/courses/Silverlight4/ImageBrowser/&quot;&gt;Image Browser Lab&lt;/a&gt; lab to teach myself some of the newer features in Silverlight 4.&amp;#160; If you haven’t tried that lab as yet, you should, it shows you how to build a really cool Image browsing application which supports moving, resizing, and rotating images on a canvas.&amp;#160; It also shows you how to enable the scenario where a user can drag pictures from their hard drive and into the Silverlight application.&amp;#160; Very cool stuff!&amp;#160; Here’s a picture of the page in action:&lt;/p&gt;  &lt;p&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0gf2Nz7VyWBvfCIbOxbF8JGcOmqcr5umPSeFd3COFxOkl-K1Epoc96ew2nmVSXWaehu94VGaKl-jZYXz8zF5dJmsJB0Iz1juhlwC1_sD7kJKwRDiVX0b3sLe_2do5LCiUEX07Kv7SyjGx/s1600-h/image%5B3%5D.png&quot;&gt;&lt;img style=&quot;border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtmGmUImCBNTfhbutKronnMf3Zl48LtjVmYFlNyTp-irnVEdmfSq5T_EVaFqyb0CG-5xNl8EX8_b3NILcA8sW4d5fc6zY6ko5YRxumdxTAUa2TWxh3WxKSREo5GoAcPdEbf03ECkxcyah5/?imgmax=800&quot; width=&quot;821&quot; height=&quot;416&quot; /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;As you will notice, in this tutorial, it shows you how to add the yellow drag handles that you see on the middle photo so that you can resize and move the images around.&amp;#160; And as also mentioned, you can drag images in off of your own hard drive.&amp;#160; If you have 5 minutes to spare, here is a link to &lt;a href=&quot;http://www.silverlight.net/learn/videos/silverlight-4-beta-videos/silverlight-controls-drop-targets/&quot; target=&quot;_blank&quot;&gt;a video by Jesse Liberty which shows how simple it is to get Drag and Drop working&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;What happens if you cannot get Drag and Drop to work in your Silverlight application?&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;OK, call me a simpleton, but this got me today and so I’m going to put it out there to hopefully save some other poor sucker the hour it took me to work out what was going on.&amp;#160; Emboldened after having worked through this exercise, I decided to implement some Drag and Drop goodness in one of my own applications.&amp;#160; I added the few lines of mark up and code that are required to get things working, ran it up with F5, and nothing!&amp;#160; Zip!&amp;#160; Drag and Drop was not working for me.&lt;/p&gt;  &lt;p&gt;The long of the short of it is that I had started the instance of Visual Studio in elevated mode.&amp;#160; What this meant was that Windows was protecting me by not allowing me to drag files from my Windows Explorer instance (which was not elevated) into my IE process (which was).&lt;/p&gt;  &lt;p&gt;So after about an hour of scratching my head, it turned out to be a simple fix.&amp;#160; And now I have drag and drop functionality in my own application! &lt;img alt=&quot;Hot&quot; src=&quot;http://messenger.msn.com/MMM2006-04-19_17.00/Resource/emoticons/shades_smile.gif&quot; /&gt;&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://2010wave.blogspot.com/feeds/4977931972200324252/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://2010wave.blogspot.com/2010/01/using-drag-and-drop-in-silverlight-4.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8879753012890807179/posts/default/4977931972200324252'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8879753012890807179/posts/default/4977931972200324252'/><link rel='alternate' type='text/html' href='http://2010wave.blogspot.com/2010/01/using-drag-and-drop-in-silverlight-4.html' title='Using Drag and Drop in a Silverlight 4 Application'/><author><name>Darren Neimke</name><uri>http://www.blogger.com/profile/04138573191558270297</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://markitup.com/images/MyPicture_Small.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtmGmUImCBNTfhbutKronnMf3Zl48LtjVmYFlNyTp-irnVEdmfSq5T_EVaFqyb0CG-5xNl8EX8_b3NILcA8sW4d5fc6zY6ko5YRxumdxTAUa2TWxh3WxKSREo5GoAcPdEbf03ECkxcyah5/s72-c?imgmax=800" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8879753012890807179.post-5734531410325665249</id><published>2010-01-05T13:53:00.000-08:00</published><updated>2010-01-05T14:22:25.602-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Kindle"/><title type='text'>New Year&amp;#39;s Resolution #1 - Buy a Kindle</title><content type='html'>&lt;span&gt;&lt;iframe style=&quot;width: 131px; padding-right: 10px; height: 245px; padding-top: 5px; align: left&quot; marginheight=&quot;0&quot; src=&quot;http://rcm.amazon.com/e/cm?t=forestlakewebser&amp;amp;o=1&amp;amp;p=8&amp;amp;l=bpl&amp;amp;asins=B00154JDAI&amp;amp;fc1=000000&amp;amp;IS2=1&amp;amp;lt1=_blank&amp;amp;m=amazon&amp;amp;lc1=0000FF&amp;amp;bc1=000000&amp;amp;bg1=FFFFFF&amp;amp;f=ifr&quot; frameborder=&quot;0&quot; marginwidth=&quot;0&quot; scrolling=&quot;no&quot; align=&quot;left&quot;&gt;&lt;/iframe&gt;For the last couple of years I&#39;ve allowed my interest in technology to take a back seat while I spent more time with Uni studies and gaining knowledge and experience as a hockey coach.&amp;#160; This year however I&#39;ve promised that I will immerse myself in the latest rounds of technology - hence this blog.&amp;#160; &lt;/span&gt;  &lt;br /&gt;  &lt;br /&gt;&lt;span&gt;A big part of my life with technology has always been the software that I create - and this only gets better with the current wave - but I&#39;ve not really been much of a gadget guy.&amp;#160; This is all changing though and now that we have Kindle in Australia I&#39;ve decided to invest in one.&lt;/span&gt;   &lt;br /&gt;  &lt;br /&gt;&lt;span&gt;This was a big decision for me and I thought long and hard about whether to get a Kindle or to purchase a Netbook.&amp;#160; The attraction of having a device of this type was mostly so that I can extend my reading - especially of technical articles - to the 2 hour daily bus commute.&amp;#160; And the decision point between a Kindle and a Netbook really came down to the fact that you can do a lot more on a Netbook than you can on a Kindle.&amp;#160; For example, if I was reading a PDF tutorial on how to use PowerShell, then using a Netbook I could easily fire up PowerShell and try some of that stuff right there and then.&lt;/span&gt;   &lt;br /&gt;  &lt;br /&gt;&lt;span&gt;The thing that swayed me away from buying a Netbook in the end was mostly that the Netbook market is still such a changing landscape and, to get the Netbook that I wanted I would probably have ended up spending around $700 anyways.&amp;#160; &lt;/span&gt;  &lt;br /&gt;  &lt;br /&gt;&lt;span&gt;So the final decision was: spend $300 on a Kindle and solve my immediate reading need problem, then tackle a small form-factor PC later in the year.&lt;/span&gt;   &lt;br /&gt;  &lt;br /&gt;&lt;span&gt;Oh yeah, and with the $AUD doing so well against the $USD... how could I afford &lt;em&gt;not&lt;/em&gt; to buy one! &lt;img alt=&quot;Smile&quot; src=&quot;http://messenger.msn.com/MMM2006-04-19_17.00/Resource/emoticons/regular_smile.gif&quot; /&gt;&lt;/span&gt;  </content><link rel='replies' type='application/atom+xml' href='http://2010wave.blogspot.com/feeds/5734531410325665249/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://2010wave.blogspot.com/2010/01/new-years-resolution-1-buy-kindle.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8879753012890807179/posts/default/5734531410325665249'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8879753012890807179/posts/default/5734531410325665249'/><link rel='alternate' type='text/html' href='http://2010wave.blogspot.com/2010/01/new-years-resolution-1-buy-kindle.html' title='New Year&amp;#39;s Resolution #1 - Buy a Kindle'/><author><name>Darren Neimke</name><uri>http://www.blogger.com/profile/04138573191558270297</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://markitup.com/images/MyPicture_Small.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8879753012890807179.post-4011737152122894182</id><published>2010-01-01T18:36:00.001-08:00</published><updated>2010-01-05T03:42:13.889-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET MVC"/><category scheme="http://www.blogger.com/atom/ns#" term="Autofac"/><category scheme="http://www.blogger.com/atom/ns#" term="Dependency Injection"/><category scheme="http://www.blogger.com/atom/ns#" term="IoC"/><title type='text'>Walkthrough using Autofac as your IoC Container in an ASP.NET MVC application</title><content type='html'>&lt;div style=&quot;border-bottom: black 1px solid; border-left: black 1px solid; background-color: yellow; border-top: black 1px solid; border-right: black 1px solid&quot;&gt;&lt;strong&gt;&lt;font color=&quot;#ff0000&quot;&gt;Note:&lt;/font&gt;&lt;/strong&gt; The Autofac assemblies that I used to write this sample are part of the latest Beta version – which is a bit of a moving target.&amp;#160; I know that the most recent build of that major version has changed since I wrote this stuff, so you might want to keep an eye on &lt;a href=&quot;http://nblumhardt.com&quot; target=&quot;_blank&quot;&gt;Nick’s blog&lt;/a&gt; to learn about any changes that are occurring in the codebase.&amp;#160; One significant change you will need to know about if you are planning to work through this article is the change that he has made to how ASP.NET MVC Controllers are registered with the Container.&amp;#160; You can &lt;a href=&quot;http://nblumhardt.com/2010/01/mvc-integration-changes-in-autofac-beta-2-1-6/&quot; target=&quot;_blank&quot;&gt;read about that change here&lt;/a&gt;.&lt;/div&gt;  &lt;p&gt; If you are building properly structured software where you have correctly implemented separation of concerns (SOC) then wiring up dependencies for classes starts to become quite an exercise. Here&#39;s an example from the a &lt;a href=&quot;http://dotnetslackers.com/articles/designpatterns/InversionOfControlAndDependencyInjectionWithCastleWindsorContainerPart1.aspx&quot;&gt;great series of articles on the topic of &lt;/a&gt;IoC and DI that I recommend you read to learn more about the topic which shows how verbose and complex things can become:&lt;/p&gt;  &lt;pre class=&quot;csharpcode&quot;&gt;IFileDownloader downloader = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; HttpFileDownloader(); &lt;br /&gt;ITitleScraper scraper = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; StringParsingTitleScraper(); &lt;br /&gt;HtmlTitleRetriever retriever = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; HtmlTitleRetriever(downloader, scraper);&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Commonly when you use simple dependency injection in this manner you find that some services are reliant upon many other components and their construction becomes very messy. You can imagine what this starts to look like when you have lots of type registration and dependency injection to do right across your application! &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;In this article I am going to get you up and running using &lt;a href=&quot;http://code.google.com/p/autofac/&quot; target=&quot;_blank&quot;&gt;Autofac&lt;/a&gt; as the IoC container that will handle all of the lifetime management of your dependencies and do the dependency injection for you. To get the ball rolling, go ahead and create a new solution called SimpleAutofac:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7urjUGGG2vm7l_Tf-inWMPs03T47nv15E3txbSnEdHMAmArXaOJnd_wV3GsMm9qT7J4MUi7Bwoj83TRM_3HtgU24WtM0TBa6q6eB7mFeip484hdv-xTD_Z-8_eeyLlXcatPjiz6EEFFba/s1600-h/clip_image001%5B4%5D.png&quot;&gt;&lt;img style=&quot;border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px&quot; title=&quot;clip_image001&quot; border=&quot;0&quot; alt=&quot;clip_image001&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgT-vshLHgZJ2LOkTczoOwo-n8e7L1E7fBIakJZunH8pljoDsnXO2nx4JtCWEkMXW3cIXvBkQXUikEoPJUnDGb_tJflJYq-PZbJio4jvBOw0s0Utnw9mqZqG6mQZA74VANqRTDKXedM0X4/?imgmax=800&quot; width=&quot;318&quot; height=&quot;315&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;I like to structure my source code so that the main branch of the application lives within a folder named trunk and that my external dependencies are referenced from a folder which lives above that. Create a folder for your Autofac dependencies, grab the latest build of &lt;a href=&quot;http://code.google.com/p/autofac/&quot;&gt;Autofac&lt;/a&gt; and add its binaries to the folder you just created.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrihoFdIU7wtSBhpNeQFxYQb38w4dQe3bBoyxpTb9i_E5ztFNNE8vzJ_auzE6WSlOcDlxtwCtOA-38tvkVCo8xXrZDpKT8aL1bPDD_K-8KJXZa_tsNxwCBiss2u9It4cLwQFaNOZN4az1G/s1600-h/clip_image002%5B5%5D.png&quot;&gt;&lt;img style=&quot;border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px&quot; title=&quot;clip_image002&quot; border=&quot;0&quot; alt=&quot;clip_image002&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2Oy8Ud24QNtZQlqpMyYA68V2ohpai7OrSaESkJYj56Fnyw8Z2C8EdWqnxwnwNWofwxWhXYL04_254WzBZR8kn0eBIPM5rUZTnCMpN_4L1AQVspD_X_PchmEvouAjWqipC-HORpWb4p7xP/?imgmax=800&quot; width=&quot;212&quot; height=&quot;288&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;You should get the following list of assemblies added to your Autofac dependencies folder&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfEySNdeDzU27kdCqCGzub6XiUoHjDepyNGeFFRBnigQVq47a9_Cgs8kzOQjkVwxabt3TWC8vYstf5YWqxE9ZJXRmDc1iZRAndq3HX029aSHzl5WbT9fUx41QNTGgLiFCY195hhcpsHY1u/s1600-h/clip_image003%5B7%5D.png&quot;&gt;&lt;img style=&quot;border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px&quot; title=&quot;clip_image003&quot; border=&quot;0&quot; alt=&quot;clip_image003&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEidjeLwL24UtNG4qOqipQiko0-UdOlpTxHdYIOhUAf2YTxDGjDq2sJwz6S8l8UQF1rsGxVUBvozUwqX1MHW19C4gDZCYV81hOcmpK5TL2gkBqh1Ik8vKV3g9o8aOi8gbS2zzwyXyw0KHSub/?imgmax=800&quot; width=&quot;580&quot; height=&quot;311&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Next add a reference from your SimpleAutofac project in Visual Studio to the Autofac.dll, Autofac.Configuration.dll and the Autofac.Integration.Web.dll assemblies. Having done that, we can wire up Autofac into our web application and start registering types. The first thing is to take advantage of the Autofac.Integration.Web.dll which contains the AutofacControllerFactory class that can be used at the ControllerBuilder’s current ControllerFactory.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;static&lt;/span&gt; IContainerProvider _containerProvider;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;protected&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; Application_Start()&lt;br /&gt;{&lt;br /&gt;     RegisterRoutes(RouteTable.Routes);&lt;br /&gt;&lt;br /&gt;     var containerBuilder = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; ContainerBuilder();&lt;br /&gt;     containerBuilder.RegisterModule(&lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; AutofacControllerModule(Assembly.GetExecutingAssembly()));&lt;br /&gt;     _containerProvider = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; ContainerProvider(containerBuilder.Build());&lt;br /&gt;&lt;br /&gt;     ControllerBuilder.Current.SetControllerFactory(&lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; AutofacControllerFactory(_containerProvider));&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;We need to make a minor alteration to the web.config file to include an Http Module that Autofac will use to dispose &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;httpModules&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;     &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;add&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&amp;quot;ContainerDisposal&amp;quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&amp;quot;Autofac.Integration.Web.ContainerDisposalModule, Autofac.Integration.Web&amp;quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;httpModules&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The ContainerDisposal module requires us to implement the Autofac IContainerProviderAccessor interface on our Application class, which, in-turn, mandates that we expose the ContainerProvider as a property on the class. Go ahead and add the following lines of code to your Application class:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; IContainerProvider ContainerProvider&lt;br /&gt;{&lt;br /&gt;     get { &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; _containerProvider; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;strike&gt;&lt;span class=&quot;kwrd&quot;&gt;protected&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; Application_EndRequest(&lt;span class=&quot;kwrd&quot;&gt;object&lt;/span&gt; sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;     ContainerProvider.EndRequestLifetime();&lt;br /&gt;}&lt;/strike&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;You can read more about the Autofac MVC integration on the &lt;a href=&quot;http://code.google.com/p/autofac/wiki/MvcIntegration&quot;&gt;project&#39;s Wiki page&lt;/a&gt;. That&#39;s all there is to it, press F5 and your application should now run.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhttAcPhPHPckc0XZ4a3rDgXImEg68gUxJNYrYeVBlQQ0PlIOMgNU3aTgaOUPsdalxiP43pAQdXwQ1fXSTRlAYf1oyL4sr6pUfdaMJoffySebG9BUWDjv_DFTWYej0IpPap1AOtc-UVAoNv/s1600-h/clip_image004%5B5%5D.png&quot;&gt;&lt;img style=&quot;border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px&quot; title=&quot;clip_image004&quot; border=&quot;0&quot; alt=&quot;clip_image004&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqipc2WN4nhhlrkbYjlZSpLXJ1J9utgLdTOnNWN884zQSrYtq-tbCesmq15IruZUpymFtTN_haVsDSWlEJ_HS7h19tFPFjDfUntBbr6nZ2dsRqqnFKK4Lo9x8AS5XRYnfHJf92BrhX8zaK/?imgmax=800&quot; width=&quot;597&quot; height=&quot;296&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Note that the Controllers are now being served by our Autofac IoC container and so we can now demonstrate the advantages that we get from this by going and adding some dependencies to our Controller classes and see that they get injected at runtime for us.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Create a new interface called IMessageProvider in the Models folder of the web project.&amp;#160; We will use this as a dependency that we’ll then pass to controller classes:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;namespace&lt;/span&gt; SimpleAutofac.Models&lt;br /&gt;{&lt;br /&gt;     &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;interface&lt;/span&gt; IMessageProvider&lt;br /&gt;     {&lt;br /&gt;          &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; EchoMessage(&lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; message);&lt;br /&gt;     }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;And now create a concrete instance of that interface that we will use in our application. For the sake of giving meaning to the demo, let&#39;s name our class SqlMessageProvider and imagine that this class is responsible for retrieving messages from a SQL Server database. Our class will look like this:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;namespace&lt;/span&gt; SimpleAutofac.Models&lt;br /&gt;{&lt;br /&gt;     &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; SqlMessageProvider : IMessageProvider&lt;br /&gt;     {&lt;br /&gt;          &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; EchoMessage(&lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; message)&lt;br /&gt;          {&lt;br /&gt;               &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt;.Format(&lt;span class=&quot;str&quot;&gt;&amp;quot;{0} returned from message provider.&amp;quot;&lt;/span&gt;, message);&lt;br /&gt;          }&lt;br /&gt;     }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Next we will wire up our implementation with our container so that it knows what class to return within our web application whenever an IMessageProvider is required. Go back to the Application class in Global.asax.cs and add the following registration instruction to our container builder:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class=&quot;csharpcode&quot;&gt;containerBuilder.RegisterType&amp;lt;SqlMessageProvider&amp;gt;().As&amp;lt;IMessageProvider&amp;gt;();&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Finally, go to the HomeController class and create a constructor which takes an IMessageProvider instance and then change the code in the Index action handler so that it gets its message from the IMessageProvider service as opposed to being a raw string:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;namespace&lt;/span&gt; SimpleAutofac.Controllers&lt;br /&gt;{&lt;br /&gt;     &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; HomeController : Controller&lt;br /&gt;     {&lt;br /&gt;          &lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;readonly&lt;/span&gt; IMessageProvider messageProvider;&lt;br /&gt;&lt;br /&gt;          &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; HomeController(IMessageProvider messageProvider)&lt;br /&gt;          {&lt;br /&gt;               &lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;.messageProvider = messageProvider;&lt;br /&gt;          }&lt;br /&gt;&lt;br /&gt;          &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; ActionResult Index()&lt;br /&gt;          {&lt;br /&gt;               ViewData[&lt;span class=&quot;str&quot;&gt;&amp;quot;Message&amp;quot;&lt;/span&gt;] = &lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;.messageProvider.EchoMessage(&lt;span class=&quot;str&quot;&gt;&amp;quot;Welcome to ASP.NET MVC!&amp;quot;&lt;/span&gt;);&lt;br /&gt;               &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; View();&lt;br /&gt;          }&lt;br /&gt;          &lt;br /&gt;          &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; ActionResult About()&lt;br /&gt;          {&lt;br /&gt;               &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; View();&lt;br /&gt;          }&lt;br /&gt;     }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Now press F5 to run the application and you should see that our Autofac container did indeed handle the type registration for us and it successfully injected the correct IMessageProvider instance into our HomeController class.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2WGjZJnPnJNUNb-fAXKUqvFNWQzbkb8CSbH7k0DX2S7RCSDL_3sD6DTlFRrmNJgQ7S-v481ELhCXsmCdG_huMCqb7P0DIs9sqv9sa2TqhXZFGAeOk3070gRiuzlytbTBAOLgGQiN0DaP1/s1600-h/clip_image005%5B4%5D.png&quot;&gt;&lt;img style=&quot;border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px&quot; title=&quot;clip_image005&quot; border=&quot;0&quot; alt=&quot;clip_image005&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6T9h4egWZyeDKseixgdwS6h3k5RXjwP5qicOKk19XocDTNE6D4MCfMlmmx0e-FQzVLFVvIGTOIUtseSxlTiKXpkrK9klqoMmnZcGLeuz-D8jzB9Luq5A0W-vGHeAWojMrhbGLC1Jckg4Q/?imgmax=800&quot; width=&quot;472&quot; height=&quot;189&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The last thing that I want to show is how to pass a connection string to our SqlMessageProvider instance whenever it is instantiated.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Go back to our SqlMessageProvider class and add a constructor that takes a connection string as an argument. Change the EchoMessage so that it shows us which connection our message came from:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; connectionString = &lt;span class=&quot;str&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; SqlMessageProvider(&lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; connectionString)&lt;br /&gt;{&lt;br /&gt;     &lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;.connectionString = connectionString;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; EchoMessage(&lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; message)&lt;br /&gt;{&lt;br /&gt;     &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt;.Format(&lt;span class=&quot;str&quot;&gt;&amp;quot;{0} returned from {1} provider.&amp;quot;&lt;/span&gt;, &lt;br /&gt;          message, &lt;br /&gt;          &lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;.connectionString);&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;style type=&quot;text/css&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, &quot;Courier New&quot;, courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Now go back to the Application class and change the IMessageProvider registration so that it takes a specific instance that we&#39;ve already pre-configured with our connection string information&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class=&quot;csharpcode&quot;&gt;var connectionString = &lt;span class=&quot;str&quot;&gt;&amp;quot;DarrensSqlServer&amp;quot;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;var containerBuilder = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; ContainerBuilder();&lt;br /&gt;containerBuilder.Register(c =&amp;gt; &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; SqlMessageProvider(connectionString)).As&amp;lt;IMessageProvider&amp;gt;();&lt;br /&gt;containerBuilder.RegisterModule(&lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; AutofacControllerModule(Assembly.GetExecutingAssembly()));&lt;br /&gt;&lt;br /&gt;_containerProvider = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; ContainerProvider(containerBuilder.Build());&lt;br /&gt;&lt;br /&gt;ControllerBuilder.Current.SetControllerFactory(&lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; AutofacControllerFactory(_containerProvider));&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEicAuDuEBgPya1OmJnTvOD6pHcYNcwbKVqqtjtcDYO29KL-AuKNh2u9x1QKjuW42Un3e2yJtLcrSdSDZCr4_CO5do5ins2kpaFF0R4YzAxs0UOlF6dxe7QBpVb3JAf1zY_26Y2LJeMnBCrt/s1600-h/clip_image006%5B4%5D.png&quot;&gt;&lt;img style=&quot;border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px&quot; title=&quot;clip_image006&quot; border=&quot;0&quot; alt=&quot;clip_image006&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYlTP9T0TyiBh_HuejGIhMS-d0oZwsstYwjVaWI5bpqXtkg-WyC2i4KttFf8TqBeXXdyLHi2T5RPQy9Dv_T2_234L7OLye0pJOrvNqow0WnYy2VH0qp3a6hKreogbJGEoE6UqQAHxmj5x7/?imgmax=800&quot; width=&quot;436&quot; height=&quot;173&quot; /&gt;&lt;/a&gt;&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://2010wave.blogspot.com/feeds/4011737152122894182/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://2010wave.blogspot.com/2010/01/walkthrough-using-autofac-as-your-ioc.html#comment-form' title='9 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8879753012890807179/posts/default/4011737152122894182'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8879753012890807179/posts/default/4011737152122894182'/><link rel='alternate' type='text/html' href='http://2010wave.blogspot.com/2010/01/walkthrough-using-autofac-as-your-ioc.html' title='Walkthrough using Autofac as your IoC Container in an ASP.NET MVC application'/><author><name>Darren Neimke</name><uri>http://www.blogger.com/profile/04138573191558270297</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://markitup.com/images/MyPicture_Small.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgT-vshLHgZJ2LOkTczoOwo-n8e7L1E7fBIakJZunH8pljoDsnXO2nx4JtCWEkMXW3cIXvBkQXUikEoPJUnDGb_tJflJYq-PZbJio4jvBOw0s0Utnw9mqZqG6mQZA74VANqRTDKXedM0X4/s72-c?imgmax=800" height="72" width="72"/><thr:total>9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8879753012890807179.post-560633474852892675</id><published>2009-12-31T20:15:00.001-08:00</published><updated>2010-01-01T18:39:23.274-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET MVC"/><title type='text'>How to create Areas in ASP.NET MVC</title><content type='html'>&lt;p&gt;In ASP.NET MVC we can use the concept of Areas to segregate different functional areas of development into separate projects. This segregation can help make our code easier to maintain - especially among a team of developers because it means that a new programmer potentially has less code to wade through when they come to maintain a specific feature.&lt;/p&gt;  &lt;p&gt;In this blog post we will look at how to create an ASP.NET MVC Area and wire it up into our application. To get things started, create a new Visual Studio ASP.NET MVC2 project named AreasDemo&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKzvIxK9_QZ9qTMJtOoKjUmnpSzLM4tW0f9XVmNWsimIzgip7bUqybtBMDERvPawJpVuAI4dVvW4whXAwnBU8WGR5KO9YyA8qf8UWDTwPFOg1BZDInZ5pqPoD7FejNxwTJjxCW2u7Grpwh/s1600-h/clip_image0014.png&quot;&gt;&lt;img style=&quot;border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px&quot; title=&quot;clip_image001&quot; border=&quot;0&quot; alt=&quot;clip_image001&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYEM8AiYkONsycfDnw9VD24cy72ioejaZU40eE6JWGCkUALycC3usZ5tIFY-nvH3PCPZwnXXFtrpWSL9dX2qXPvNyBpHK_XjJjS8EVQBtdRut-G9v33p7bpIyc_yHWlh11AD9mShj3YauA/?imgmax=800&quot; width=&quot;497&quot; height=&quot;270&quot; /&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;When your project opens up you can see the standard, base ASP.NET MVC project template files are included. &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjwx1_uUCEuam_SMA_0kG-ZOoxXO9XwTuQoH6v1n_hgK4bUKprnVkKEON-LBMyUzOpdg9NqacnU_ETOFL5z3-Rso8I5BeAYGFztCdQXpbGrAaIeE86HHkZ3A3eR3bQAiYFw0k7ECfXqoex/s1600-h/clip_image0024.png&quot;&gt;&lt;img style=&quot;border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px&quot; title=&quot;clip_image002&quot; border=&quot;0&quot; alt=&quot;clip_image002&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-gF-SEi-wVKBufARET614Naukfg10I_5wf_badlhEPf5SAT0gk4cxCiu3tMc4L-4jsdtHbMaQZoC4appLVeVt_fvIPSCU6UAHAPlq_i6CigZjG0rG7u8qL7zj7_Jc_7a7ODiPYo8O53vk/?imgmax=800&quot; width=&quot;267&quot; height=&quot;351&quot; /&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Next we are going to add a new area that will provide the functionality for managing and viewing Favorites. To get things started, add a new ASP.NET MVC2 project to the solution and name it FavoritesArea&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi76ckhaTY20w-WEQwudRFRy8QfUFAgRnHJHuviKpNeidsSYPVmVAqKmWSq-xlDDwEyC5iR1fpALkc87wDAbfD8WVa2R5koADNgcnw7VaIx0khB5r6H_nncgBo7yp_RR9y1CVit-22IVIN_/s1600-h/clip_image0034.png&quot;&gt;&lt;img style=&quot;border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px&quot; title=&quot;clip_image003&quot; border=&quot;0&quot; alt=&quot;clip_image003&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjb8tsaRB40r7bJFqiLVhSqNpaII3A8ZgTuVmiELg0OOyS2p0tD0y1QkM-Wtt_47HMbzxC-_gzGe3Pjoc_cwL5aU3eq0gzyMW6Q7v6ohzuWFSk2MaR46xFPbsKE8STF0N5aQUEe__AH9WgE/?imgmax=800&quot; width=&quot;527&quot; height=&quot;236&quot; /&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Remove all of the content from the FavoritesArea project but leave the Controllers and Models folders&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgy-VKtGV-xYpUNN5m3y3oqRvSzvgP0WR3wTdQL1o5AcX3asM_A7VbBJrk4gedQxogWhdX41Sn4LVsAUkmOHcOnI7fZpe1nczwQTAZ-IvvS7EBR9BZFz02nJKaOxTljuCvJE5A_aHIRlIw0/s1600-h/clip_image0044.png&quot;&gt;&lt;img style=&quot;border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px&quot; title=&quot;clip_image004&quot; border=&quot;0&quot; alt=&quot;clip_image004&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFixTk_9o5CTHAvrnzSwKvr-bWpbDJnw-kDJ8zV3McXFWSHQSAq_kB8tdCpKkOjUqgKnaB1-ApGOeoBs3_LehbE9C3H0x1g-tG0EM805Rpcf1tqqvKCTBNyVZTbtD68aXMdsLMjc5Lyl4H/?imgmax=800&quot; width=&quot;242&quot; height=&quot;362&quot; /&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;The only things that will live in the *Area projects will be code - Controllers, Routing configuration, Models, and ViewModels. Let&#39;s go ahead and create a simple C# class called Favorite which will encapsulate a domain object for our Favorites functional area.&lt;/p&gt;  &lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;namespace&lt;/span&gt; FavoritesArea.Models&lt;br /&gt;{&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; Favorite&lt;br /&gt;    {&lt;br /&gt;        &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; Title { get; set; }&lt;br /&gt;        &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt; Rating { get; set; }&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;For this example, we will be creating a single View for our Favorites functional area called Index; the Index view will be the default view for the Favorites functional area and will simply show a list of favorites. Add a Controller class to the FavoritesArea project which looks like so:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; FavoritesController : Controller&lt;br /&gt;{&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; ActionResult Index()&lt;br /&gt;    {&lt;br /&gt;        var favorites = GetFavorites();&lt;br /&gt;        &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; View(favorites);&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    List&amp;lt;Favorite&amp;gt; GetFavorites()&lt;br /&gt;    {&lt;br /&gt;        &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; List&amp;lt;Favorite&amp;gt; &lt;br /&gt;        {&lt;br /&gt;            &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; Favorite { Title = &lt;span class=&quot;str&quot;&gt;&amp;quot;First Favorite&amp;quot;&lt;/span&gt;, Rating = 3 },&lt;br /&gt;            &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; Favorite { Title = &lt;span class=&quot;str&quot;&gt;&amp;quot;Second Favorite&amp;quot;&lt;/span&gt;, Rating = 5 },&lt;br /&gt;            &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; Favorite { Title = &lt;span class=&quot;str&quot;&gt;&amp;quot;Third Favorite&amp;quot;&lt;/span&gt;, Rating = 3 },&lt;br /&gt;        };&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Notice that the Index method of this controller class simply returns a hard-coded list of Favorite domain objects.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Next we will add routing information for the Area so that the ASP.NET MVC runtime knows how to access the controller and view for our Favorites function. From within the FavoritesArea project create a new class named Routes - the name is not important but make sure to inherit from the ASP.NET MVC AreaRegistration base class). When you have your Routes class add the following code to it&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; Routes : AreaRegistration &lt;br /&gt;{                                           &lt;br /&gt;   &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;override&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; RegisterArea(AreaRegistrationContext context)    &lt;br /&gt;   {        &lt;br /&gt;       context.MapRoute(&lt;br /&gt;           &lt;span class=&quot;str&quot;&gt;&amp;quot;favorites_default&amp;quot;&lt;/span&gt;, &lt;br /&gt;           &lt;span class=&quot;str&quot;&gt;&amp;quot;Favorites/{controller}/{action}/{id}&amp;quot;&lt;/span&gt;,                             &lt;br /&gt;           &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; {&lt;br /&gt;               controller = &lt;span class=&quot;str&quot;&gt;&amp;quot;Favorites&amp;quot;&lt;/span&gt;, &lt;br /&gt;               action = &lt;span class=&quot;str&quot;&gt;&amp;quot;Index&amp;quot;&lt;/span&gt;, &lt;br /&gt;               id = &lt;span class=&quot;str&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;br /&gt;           }&lt;br /&gt;           );    &lt;br /&gt;   }&lt;br /&gt;   &lt;br /&gt;   &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;override&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; AreaName&lt;br /&gt;   {        &lt;br /&gt;       get { &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&amp;quot;Favorites&amp;quot;&lt;/span&gt;; }    &lt;br /&gt;   }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The 3 things to take notice of here are:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;  &lt;li&gt;We&#39;ve derived from &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.web.mvc.arearegistration(VS.100).aspx&quot; target=&quot;_blank&quot;&gt;AreaRegistration&lt;/a&gt; &lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;We&#39;ve overridden the &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.web.mvc.arearegistration.registerarea(VS.100).aspx&quot; target=&quot;_blank&quot;&gt;RegisterArea&lt;/a&gt; method to add our own routing configuration &lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;We&#39;ve overridden the &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.web.mvc.arearegistration.areaname(VS.100).aspx&quot; target=&quot;_blank&quot;&gt;AreaName&lt;/a&gt; property to provide the key name for our Area &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Add a reference to the FavoritesArea assembly from the AreaDemo project:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;  &lt;p&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCd0xmwFOeypjz-hlm27rvKlQwlYGzG5yUhtoDME-oWHTj7lsp9d2w7afOjEsSg9OM-lYalL3qQglKIc1edVIXWh0qJC6LpSp0JRVZwJaocmP6k5MdLJ4VgLzT7D8V01RNr1N5SSD4EU9e/s1600-h/clip_image0053.png&quot;&gt;&lt;img style=&quot;border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px&quot; title=&quot;clip_image005&quot; border=&quot;0&quot; alt=&quot;clip_image005&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2xfau-yFq-3iP31i0BWnitQyre-51p5Ef-e_NFDPuZIqE7v83oJhEfiMjcX5O-ji0FcNvbDndW-8Y1hVw_u_CR9XV8_k8FoLjh43ES_0ftARfwbxWzgh5y0pbObVp870MbwwgiRUoqSut/?imgmax=800&quot; width=&quot;241&quot; height=&quot;244&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;In the Application class of the AreasDemo project, add a line of code which invokes Area registration [1]:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;protected&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; Application_Start()&lt;br /&gt;{&lt;br /&gt;    AreaRegistration.RegisterAllAreas();&lt;br /&gt;    RegisterRoutes(RouteTable.Routes);&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;In the AreasDemo project, create a strongly-typed view named Index and then select your View data class.&amp;#160; In our case, that will be the Favorite domain class that we created earlier.&amp;#160; The view should be added to a folder named Favorites which will live underneath the Views folder.&amp;#160; Therefore the full path to the view file in your Visual Studio project will be &lt;strong&gt;/Views/Favorites/Index.aspx&lt;/strong&gt;.&amp;#160; You cannot see it in the following image (because the Types dropdown is covering it) but you should also select List as the View Content type as this will automatically display our Favorites list for us.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;  &lt;p&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhody28r3Utw8MrqouduSy6q-VNEY9eFfU6ky2Le1Y-6VT8nm2R_NhH1TwF8pKG4Mj5QGSd0jqNnwXSZ1GldlVnLQwBms4CnMIpjnOP_pugA6tBUAL1ULRb0DwJzCZZN6cIi1f5KPdpQcxH/s1600-h/clip_image0061.png&quot;&gt;&lt;img style=&quot;border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px&quot; title=&quot;clip_image006&quot; border=&quot;0&quot; alt=&quot;clip_image006&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhle45KSqkGak31Jl4s_Jmmpg6fo456DoI4SJmU6sDjta321IqxSKU1XWkyq4CbnIRDYGjSRIlNo41mGZ0P2stYX5Hanvc9z7PwWupR6sgYiFX5_D54rbxPzEx3N9klpxwURuwjDceJIhOS/?imgmax=800&quot; width=&quot;365&quot; height=&quot;362&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The last thing that we need to do to provide a way for users to navigate to our Favorites Index page.&amp;#160; To do this simply open up the Site.master file and include an additional navigation node for our view.&amp;#160; Notice that you will need to use a different overload of the ActionLink method which lets us specify an area to use.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;div&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&amp;quot;menucontainer&amp;quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;ul&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&amp;quot;menu&amp;quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;              &lt;br /&gt;        &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;li&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;asp&quot;&gt;&amp;lt;%&lt;/span&gt;= Html.ActionLink(&lt;span class=&quot;str&quot;&gt;&amp;quot;Home&amp;quot;&lt;/span&gt;, &lt;span class=&quot;str&quot;&gt;&amp;quot;Index&amp;quot;&lt;/span&gt;, &lt;span class=&quot;str&quot;&gt;&amp;quot;Home&amp;quot;&lt;/span&gt;)&lt;span class=&quot;asp&quot;&gt;%&amp;gt;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;li&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;li&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;asp&quot;&gt;&amp;lt;%&lt;/span&gt;= Html.ActionLink(&lt;span class=&quot;str&quot;&gt;&amp;quot;About&amp;quot;&lt;/span&gt;, &lt;span class=&quot;str&quot;&gt;&amp;quot;About&amp;quot;&lt;/span&gt;, &lt;span class=&quot;str&quot;&gt;&amp;quot;Home&amp;quot;&lt;/span&gt;)&lt;span class=&quot;asp&quot;&gt;%&amp;gt;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;li&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;li&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;asp&quot;&gt;&amp;lt;%&lt;/span&gt;= Html.ActionLink(&lt;span class=&quot;str&quot;&gt;&amp;quot;Favorites&amp;quot;&lt;/span&gt;, &lt;span class=&quot;str&quot;&gt;&amp;quot;Index&amp;quot;&lt;/span&gt;, &lt;span class=&quot;str&quot;&gt;&amp;quot;Favorites&amp;quot;&lt;/span&gt;, &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; { area = &lt;span class=&quot;str&quot;&gt;&amp;quot;Favorites&amp;quot;&lt;/span&gt; }, &lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt;) &lt;span class=&quot;asp&quot;&gt;%&amp;gt;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;li&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;ul&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;With these changes made the only thing that remains is to press F5 to run the application and navigate to the Favorites page:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;  &lt;p&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvVAJMRnb20wk90p1bBBR41aCWGq-SzKqeo6gbNawgf7LgcJU8TIi4xwLrF3uYUOVI4pBbzuiEU95mpC_MCRIYRDZGI44etJdZYHndblG5YuOnbDYTBP6r8gVUuOGQKMY2Fo5uo2MqUCDE/s1600-h/clip_image0071.png&quot;&gt;&lt;img style=&quot;border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px&quot; title=&quot;clip_image007&quot; border=&quot;0&quot; alt=&quot;clip_image007&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjO_TBGGVzPNWChhznlYbHKnxpyOmVLlHcV1914HYBXiSRQwk4f4Go-R_fHbCS0_YsW1X5aG5kQqQwXvKrgRZJ1fo7v9Cyq1z1b4XqV75At-pPXAV1QmZ4pf1bV64IBeazdWT7uaEMRLm75/?imgmax=800&quot; width=&quot;432&quot; height=&quot;377&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The last thing that you might like to do – for aesthetics – is to place your Area projects into a Solution Folder names Areas.&amp;#160; This again helps maintainability as it makes the structure of the solution much clearer to any potential developers:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;  &lt;p&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhcFhtSSAgYu58kR2DmKEzPR_c1vBOHpMEwEB_QPu7mTaSuQ63ZflfQ8Kr6jwMZR77AbtlapyEdWWGUpYk-LOgS8Qn21Qoi6sZ3y2Qs5AWm-tFllKqmK1H6UFgANbDw9FeFYL42VwDs-SxS/s1600-h/image%5B3%5D.png&quot;&gt;&lt;img style=&quot;border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEW1JQWNvirzF48jlHaqA3g0WJo4LqHFXSULvuQPMFHWB1aPcq3Gk7OoFjDzZ1VuRWFwz8KcA5Ipvg3lA4rms4QFsnWj35HVb36cUEmB8j9BBm6Qs4A4yza8Z9GqJ6tttfwUqavZy3fzDn/?imgmax=800&quot; width=&quot;302&quot; height=&quot;510&quot; /&gt;&lt;/a&gt; &lt;/p&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;There you have it!&amp;#160; The code for our Favorites function is now isolated from the main chunk of code which is required to bootstrap the web application.&amp;#160; This will make it easier to maintain, review and test because code can be worked on in a more focused manner.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&amp;#160;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;[1] It is important to make the call to AreaRegistration.RegisterAllAreas() prior to calling RegisterRoutes - &lt;a href=&quot;http://weblogs.asp.net/rashid/archive/2009/12/30/asp-net-mvc-2-and-why-dynamic-area-is-not-supported.aspx&quot;&gt;ASP.NET MVC 2 and why Dynamic Area is not supported&lt;/a&gt;.&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://2010wave.blogspot.com/feeds/560633474852892675/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://2010wave.blogspot.com/2009/12/how-to-create-areas-in-aspnet-mvc.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8879753012890807179/posts/default/560633474852892675'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8879753012890807179/posts/default/560633474852892675'/><link rel='alternate' type='text/html' href='http://2010wave.blogspot.com/2009/12/how-to-create-areas-in-aspnet-mvc.html' title='How to create Areas in ASP.NET MVC'/><author><name>Darren Neimke</name><uri>http://www.blogger.com/profile/04138573191558270297</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://markitup.com/images/MyPicture_Small.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYEM8AiYkONsycfDnw9VD24cy72ioejaZU40eE6JWGCkUALycC3usZ5tIFY-nvH3PCPZwnXXFtrpWSL9dX2qXPvNyBpHK_XjJjS8EVQBtdRut-G9v33p7bpIyc_yHWlh11AD9mShj3YauA/s72-c?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8879753012890807179.post-116791368280500501</id><published>2009-12-31T14:55:00.000-08:00</published><updated>2009-12-31T15:13:49.287-08:00</updated><title type='text'>2010Wave Intro Post</title><content type='html'>&lt;div&gt;Prior to 2009 I was a very regular blogger.  &lt;/div&gt;&lt;br /&gt;&lt;div&gt; &lt;/div&gt;&lt;br /&gt;&lt;div&gt;My &lt;a href=&quot;http://weblogs.asp.net/dneimke/default.aspx&quot;&gt;first blog &lt;/a&gt;started in January 2002 and was hosted on the original DotNetWeblogs service - which later became &lt;a href=&quot;http://weblogs.asp.net/&quot;&gt;http://weblogs.asp.net&lt;/a&gt;.  After that I moved my blogging activity over to &lt;a href=&quot;http://markitup.com/&quot;&gt;http://MarkItUp.com&lt;/a&gt; which was (and still is) hosted on some CMS software that I developed whilst writing my book on &lt;a href=&quot;http://www.amazon.com/exec/obidos/ASIN/193239477X/forestlakewebser&quot;&gt;ASP.NET 2.0 Web Parts&lt;/a&gt; back in 2005.  After that I turned my attention towards Windows Live and moved across to a &lt;a href=&quot;http://neimke.spaces.live.com/&quot;&gt;Live Spaces blog&lt;/a&gt;.&lt;/div&gt;&lt;br /&gt;&lt;div&gt; &lt;/div&gt;&lt;br /&gt;&lt;div&gt;Last year was the first year that I didn&#39;t blog since 2001.&lt;/div&gt;&lt;br /&gt;&lt;div&gt; &lt;/div&gt;&lt;br /&gt;&lt;div&gt;This year I have renewed enthusiasm for blogging because I&#39;m geniunely excited by all of the new technologies that I&#39;ve been playing with.  Those technologies include: ASP.NET MVC, Visual Studio 2010, Windows 7, Windows Azure, Windows Mobile, HTML5, Continuous Integration, Software Patterns, DI Containers, Automated Testing, Automated Build Systems, Managing the Release of Software, SharePoint 2010, PowerShell, MSBuild and a host of others.&lt;/div&gt;&lt;br /&gt;&lt;div&gt; &lt;/div&gt;&lt;br /&gt;&lt;div&gt;During the day I&#39;m currently on a 12 month contract with a local Adelaide-based organization where I work as a SharePoint administrator and developer.  During this work I&#39;m lucky enough to be considered as a senior member of the team and have been given quite a free license to help improve the way that we develop software.  And that&#39;s what I&#39;ll be blogging about.&lt;/div&gt;&lt;br /&gt;&lt;div&gt; &lt;/div&gt;&lt;br /&gt;&lt;div&gt;During the year I will be diving further into these technologies and plan to post my learnings to this blog.  I&#39;m not sure how often I will be posting but I think that I can aim to post about 3-4 quality posts per week on average.&lt;/div&gt;&lt;br /&gt;&lt;div&gt; &lt;/div&gt;&lt;br /&gt;&lt;div&gt;If you would like to follow me you can expect that my posts will lead you on a path towards having more control over your build and release processes for your own software development.  Hopefully this will lead to the development of many recipes for bootstrapping development and automating for both on-premise and cloud-based applications.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://2010wave.blogspot.com/feeds/116791368280500501/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://2010wave.blogspot.com/2009/12/2010wave-intro-post.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8879753012890807179/posts/default/116791368280500501'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8879753012890807179/posts/default/116791368280500501'/><link rel='alternate' type='text/html' href='http://2010wave.blogspot.com/2009/12/2010wave-intro-post.html' title='2010Wave Intro Post'/><author><name>Darren Neimke</name><uri>http://www.blogger.com/profile/04138573191558270297</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://markitup.com/images/MyPicture_Small.jpg'/></author><thr:total>2</thr:total></entry></feed>