<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>odd: &#187; ASP.NET MVC</title>
	<atom:link href="http://www.odd-uk.com/tag/aspnet-mvc/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.odd-uk.com</link>
	<description></description>
	<lastBuildDate>Sun, 05 Feb 2012 18:43:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Svghelpers for ASP.NET MVC</title>
		<link>http://www.odd-uk.com/svghelpers-for-asp-net-mvc-2/</link>
		<comments>http://www.odd-uk.com/svghelpers-for-asp-net-mvc-2/#comments</comments>
		<pubDate>Thu, 21 Oct 2010 20:06:34 +0000</pubDate>
		<dc:creator>Simon Owen</dc:creator>
				<category><![CDATA[Develop]]></category>
		<category><![CDATA[ASP.NET MVC]]></category>
		<category><![CDATA[inline SVG]]></category>
		<category><![CDATA[MVC2]]></category>
		<category><![CDATA[SVG]]></category>
		<category><![CDATA[Vector graphics]]></category>

		<guid isPermaLink="false">http://www.odd-uk.com/?p=286</guid>
		<description><![CDATA[With the latest round of browsers comes the ability to render inline SVG. Using a fluent syntax, svghelpers allows you to define SVG mark-up in ASP.NET MVC views.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just released Svghelpers for ASP.NET MVC onto github, a suite of Html Helpers, it will help you render inline SVG from MVC views.</p>
<p>You can find out more at <a href="http://svghelpers.odd-uk.com">http://svghelpers.odd-uk.com</a> and download the source at <a href="http://github.com/sowen69/SvgHelpers">http://github.com/sowen69/SvgHelpers</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.odd-uk.com/svghelpers-for-asp-net-mvc-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C# – Convert Length/Area to Points With Ease</title>
		<link>http://www.odd-uk.com/c-convert-a-number-to-points-with-ease/</link>
		<comments>http://www.odd-uk.com/c-convert-a-number-to-points-with-ease/#comments</comments>
		<pubDate>Sun, 12 Sep 2010 20:13:12 +0000</pubDate>
		<dc:creator>Simon Owen</dc:creator>
				<category><![CDATA[Develop]]></category>
		<category><![CDATA[.net extension method]]></category>
		<category><![CDATA[ASP.NET MVC]]></category>
		<category><![CDATA[IDML]]></category>
		<category><![CDATA[InDesign]]></category>

		<guid isPermaLink="false">http://www.odd-uk.com/?p=270</guid>
		<description><![CDATA[I’ve been doing quite a bit with Adobe IDML files and SVG recently, both formats work natively in Points. So I created an extension method for .NET 4 that converts a number into the equivalent value in Points.]]></description>
			<content:encoded><![CDATA[<p><html xmlns="">I’ve been doing quite a bit with Adobe IDML files and SVG recently, both formats work natively in Points. So I created an extension method for .NET 4 that converts a number into the equivalent value in Points.</p>
<p>At the moment it supports converting a double input value in millimeters (“mm”), centimeters (“cm”), meters (“m”), inches (“in”), feet (“ft”) and picas (“pc”).</p>
<p>You can convert a length or an area, the default values are input unit is mm, convert a length and return the answer to 2 decimal places. Usage is simple;</p>
<p>Using default values.</p>
<pre class="brush: csharp; title: ; notranslate">double number = 100;
double numberInPoints = number.ToPoints();</pre>
<p>Convert an Inch value to 3 decimal places.</p>
<pre class="brush:c-sharp;toolbar:false">double number = 100;
double numberInPoints = number.ToPoints("in",3);</pre>
<p>Convert an area in Centimeters to 4 decimal places.</p>
<pre class="brush:c-sharp;toolbar:false">double number = 100;
double numberInPoints = number.ToPoints("cm",4,true);</pre>
<p>And the Code is:</p>
<pre class="brush:c-sharp">using System;

namespace Odd.Maths.Convert
{
    public static class ConversionFactors
    {
        public const double mmToPoint = 2.834645669291;
        public const double cmToPoint = mmToPoint*10;
        public const double mToPoint = mmToPoint*1000;
        public const double inToPoint = mmToPoint * 25.4;
        public const double ftToPoint = (mmToPoint * 25.4) * 12;
        public const double picaToPoint = 72;
    }

    public static class ConversionExtensionMethods
    {
        public static double ToPoints(this double d, string fromUnit = "mm", int precision = 2, bool isArea = false)
        {
            switch (fromUnit)
            {
                case "mm":
                    return (isArea == true)
                        ? Math.Round(d * Math.Pow(ConversionFactors.mmToPoint, 2), precision)
                        : Math.Round(d * ConversionFactors.mmToPoint, precision);
                case "cm":
                    return (isArea == true)
                        ? Math.Round(d * Math.Pow(ConversionFactors.cmToPoint, 2), precision)
                        : Math.Round(d * ConversionFactors.cmToPoint, precision);
                case "m":
                    return (isArea == true)
                        ? Math.Round(d * Math.Pow(ConversionFactors.mToPoint, 2), precision)
                        : Math.Round(d * ConversionFactors.mToPoint, precision);
                case "in":
                    return (isArea == true)
                        ? Math.Round(d * Math.Pow(ConversionFactors.inToPoint, 2), precision)
                        : Math.Round(d * ConversionFactors.inToPoint, precision);
                case "ft":
                    return (isArea == true)
                        ? Math.Round(d * Math.Pow(ConversionFactors.ftToPoint, 2), precision)
                        : Math.Round(d * ConversionFactors.ftToPoint, precision);
                case "pc":
                    return (isArea == true)
                        ? Math.Round(d * Math.Pow(ConversionFactors.picaToPoint, 2), precision)
                        : Math.Round(d * ConversionFactors.picaToPoint, precision);
                default:
                    //Returns 0 if an incorrect fromUnit unit is specified
                    return 0;
            }

        }

    }
}</pre>
<p>It&#8217;s all quite basic with minimal (read none!) error checking but hopefully it might help someone out <img src='http://www.odd-uk.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </html></p>
]]></content:encoded>
			<wfw:commentRss>http://www.odd-uk.com/c-convert-a-number-to-points-with-ease/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bringing ASP.NET MVC to Market</title>
		<link>http://www.odd-uk.com/bringing-aspnet-mvc-to-market/</link>
		<comments>http://www.odd-uk.com/bringing-aspnet-mvc-to-market/#comments</comments>
		<pubDate>Mon, 09 Mar 2009 23:00:26 +0000</pubDate>
		<dc:creator>Simon Owen</dc:creator>
				<category><![CDATA[Develop]]></category>
		<category><![CDATA[ASP.NET MVC]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Phil Haack]]></category>

		<guid isPermaLink="false">http://www.odd-uk.com/technology/net/bringing-aspnet-mvc-to-market/</guid>
		<description><![CDATA[On January 27th Microsoft’s issued RC1 (release candidate) of their new web development framework ASP.NET MVC (Model View Controller). Not a replacement for Web Forms, MVC is billed as an alternative option when building ASP.Net web applications.]]></description>
			<content:encoded><![CDATA[<p><html xmlns="">On January 27<sup>th</sup> Microsoft’s issued RC1 (release candidate) of their new web development framework <a href="http://www.asp.net/mvc/" target="_blank">ASP.NET MVC</a> (Model View Controller). Not a replacement for Web Forms, MVC is billed as an alternative option when building ASP.Net web applications.</p>
<p>The MVC pattern is not new technology, in fact quite the opposite. First developed by <a href="http://en.wikipedia.org/wiki/Trygve_Reenskaug" target="_blank">Trygve Reenskaug</a> at Xerox Parc Labs in the late 1970s, you can find an implementation of the software pattern in most popular languages today. <a href="http://www.zend.com/" target="_blank">Zend</a> under PHP and <a href="http://rubyonrails.org/" target="_blank">Ruby on Rails</a> are just two well used applications of the MVC pattern, but Wikipedia lists twenty three separate implementations for PHP alone. It is not even the first to the party under ASP.NET &#8211; <a href="http://mavnet.sourceforge.net/ " target="_blank">Maveric.Net</a>, <a href="http://www.castleproject.org/MonoRail/" target="_blank">Monorail</a> and <a href="http://www.promesh.net/" target="_blank">ProMesh.Net</a> have all been around for some time. However, with Microsoft’s offering MVC is now rolled right into the .Net Framework.</p>
<p>An MVC application is divided into three distinct roles, Models, Views and Controllers.</p>
<ul>
<li>Models handle the maintaining of state; usually this is persisted inside a database.</li>
<li>Views are responsible for handling the display of the user interface.</li>
<li>Controllers handle user interaction and ultimately decided which view to render.</li>
</ul>
<p>This clean separation between the three roles, Model, View and Controller, makes an MVC application much easier to test. The MVC pattern also facilitates the use of red/green, or test driven development (TDD), where unit tests that define the requirements and scope of the code are written before the actual code itself.</p>
<p>ASP.NET MVC applications can be written using any of the .Net Framework languages and takes advantage of the frameworks existing support for features like authentication, membership and roles, output and data caching, session state management and the configuration system.</p>
<h3>Routing</h3>
<p>Developed as part of the MVC framework the routing engine &#8211; an exceptionally powerful URL routing system &#8211; allows you to set URL mapping rules to route incoming, and construct outgoing, URLs. The mapping rules are defined once, at the application level, within the Global.asax file. This means if you change the URL structure of your application you only need to modify this one set of mapping rules. The controllers and views in your application will continue to work totally unchanged.</p>
<p>The routing engine was initially in the <code>System.Web.Mvc.Routing</code> namespace, but has proved so useful it has been shuffled up the namespace tree into the <code>System.Web.Routing</code>, meaning it can now be used in web forms applications as well.</p>
<h3>Your Views Are Your Own</h3>
<p>The MVC framework was designed from the ground up to be pluggable and extensible. You can use Microsoft’s default routing or view engine, create your own, or swap them out the for third party offerings.</p>
<p>Out of the box views are created using .aspx pages, including full support for master and nested master pages. But you can use <em>any</em> existing templating language, with <a href="http://dev.dejardin.org/" target="_blank">spark</a> and <a href="http://nvelocity.sourceforge.net/" target="_blank">nVelocity</a> currently receiving a lot of attention. This, for web developers, is a huge plus in the frameworks favour. You can use the templating engine of <em>your</em> choice; you know nVelocity, use nVelocity. Prefer Spark? Fill your boots! You have 100% control of the angle brackets, you produce exactly the html you want.</p>
<h3>A New Microsoft?</h3>
<p>Whilst the ins and outs of the ASP.NET MVC framework are defiantly interesting and exciting for anyone developing under the .Net Framework, the way that Microsoft approached bringing the product to market is equally so. Better known for slow product cycles and closed development the MVC team appears to have instigated a paradigm shift.</p>
<p>Development of the ASP.NET MVC Framework has been open to scrutiny from a very early stage. The source code has been available for download from <a href="http://www.codeplex.com/aspnet " target="_blank">Codeplex</a>, and the team asked for the community at large to review their work. Feedback was extensive, but when pushed for details of a release date the response was always “it’ll launch when its’ ready”. Now, for a company the size of Microsoft, whose life blood is a well structured product release cycle, that’s a bold statement of intent.</p>
<p>Then there is the ASP.NET MVC team itself. In October 2007 <a href="http://weblogs.asp.net/scottgu/" target="_blank">Scott Guthrie</a>, the VP of DevDiv, hired two developers from within the .NET community. Phil Haack and Rob Conery had both developed and maintained successful open source projects, Phil with <a href="http://subtextproject.com/ " target="_blank">Subtext</a> and Rob with <a href="http://subsonicproject.com/" target="_blank">Subsonic</a>.</p>
<p>Plucking a couple of high profile and well respected open source developers, with established and widely used applications, out of the community was risky. Indeed, there was concern raised by avid fans that both Subtext and Subsonic would suffer adversely when Phil and Rob announced they would be working for Microsoft. It’s now a year down the line and both projects continue to flourish unhindered, despite the authors being assimilated by ‘the evil empire’.</p>
<p>In addition to actually getting ASP.NET MVC out the door both developers, and the rest of the MVC team, have been pumping out screencasts, application samples, and snippets of code at a prolific rate. On forums, the asp.net website and their own blogs the content just keeps rolling out. In fact the wealth of information available to anyone wanting to dip their toe in to the Microsoft flavoured MVC water is staggering; especially for a product that is yet to reach V1.0.</p>
<p>We sat down with Phil Haack to discuss how the MVC project has matured over the last twelve months and talk about his experience since joining the company.</p>
<p><strong>odd:</strong> Phil, thanks for taking the time to talk to us. You have been at Microsoft a little over twelve months now, how has the experience differed from your expectations?</p>
<p><strong>PH:</strong> One thing that has really differed from my expectations is that there is a real emphasis on work-life balance here that is more than just lip service. I expected everyone to work crazy hours all the time, but I’ve had my manager on several occasions warn me about not burning myself out. This is really a company that is in it for the long haul and you see that in many ways.</p>
<p><strong>odd</strong>: You have obviously been extremely busy in the day job, how hard has it been to keep forging ahead with Subtext?</p>
<p><strong></strong><strong>PH</strong>: Extremely hard, but partly because I have a one year old son now who is a joy to be around and I can’t rightly come home from work and ignore him and my wife. Also, I like to sleep a lot more now. I think it’s these dreary winters. After joining, I was able to help push out a 2.0 release, and I will get back into it again. Subtext development, like many OSS projects, tends to go in waves.</p>
<p><strong></strong><strong>odd</strong>: We have mentioned that the source code for the ASP.NET MVC framework is available on Codeplex, could you briefly explain the scope of the license.</p>
<p><strong></strong><strong>PH</strong>: The current license is a modified reference license. It allows you to change the source code to meet your needs, but not redistribute the code. It also allows you to go live with your application built on MVC, but at your own risk. My hope is to make the license even less restrictive than it is.</p>
<p><strong></strong><strong>odd</strong>: It has been made clear from the start that ASP.NET MVC is not a replacement for ASP.NET Web Forms but will sit alongside as an alternative option when building your applications. In what scenarios could YOU see the advantage of using MVC as opposed to Web Forms?</p>
<p><strong></strong><strong>PH</strong>: I think MVC will provide an advantage for those building public facing “Web 2.0” style applications where the importance of human friendly “hackable” URLs, clean semantic markup, agile development, etc… are of the primary importance. For other systems built for the long haul where maintainability is a primary concern, I think MVC, with its focus on testability, will be advantageous.</p>
<p><strong></strong><strong>odd</strong>: Could you give us an insight into what development methodologies were used to build out the MVC project; was is agile, did the team incorporate TDD, pair programming or continuous integration?</p>
<p><strong></strong><strong>PH</strong>: It’s rather a hodge podge of methodologies, but most closely resembles “Scrum-but”. That’s a term for anything that’s like Scrum, but differs in some ways. We have roughly daily triage meetings and weekly design meetings. We have extensive unit test coverage, as unit test coverage is required before check-in. All check-ins are peer reviewed, but we don’t do pair programming. I’d like to implement continuous integration, but we don’t have it currently in place. We have a very small number of developers so it hasn’t bitten us in the butt too often.</p>
<p><strong></strong><strong>odd</strong>: In reaching V1.0 there have been number of preview releases, how much feedback (positive and negative) did the team actually receive from the community, and how much influence did that feedback have in shaping the product we see today?</p>
<p><strong></strong><strong>PH</strong>: The amount of feedback we’ve received has been <strong>immense</strong> and has had a huge influence in shaping the product. One specific example is the sheer amount of changes from Preview 2 to Preview 3 when we introduced the ActionResult. That was a result of direct feedback from many developers who complained about how difficult it was to test their controller actions.</p>
<p>Scott Guthrie, Eilon Lipton, and I had a long design meeting in Scott’s office where we hashed out this new design. It was hard work, and set our schedule back a bit, but we feel the improved design was worth it and the response to the change has been largely positive.</p>
<p><strong></strong><strong>odd</strong>: It was recently announced that jQuery will ship as part of ASP.NET MVC, was that an easy sell to the Microsoft higher echelons?</p>
<p><strong></strong><strong>PH</strong>: I wasn’t heavily involved in the decision making at the executive level. I know that Scott Guthrie, who is a Corporate VP, was heavily in favour of it, if not the driving force for it. I’m not sure how those above him reacted, but I think you’ll see that Microsoft’s attitude towards open source appears to be shifting in a positive direction. So it probably wasn’t as tough a sell as people might think.</p>
<p><strong></strong><strong>odd</strong>: What would be your top tip for say a PHP or Ruby programmer looking to learn about developing a web site under the ASP.NET MVC framework?</p>
<p><strong></strong><strong>PH</strong>: One of the benefits of developing for ASP.NET MVC is the underlying .NET Framework that the whole stack sits on. It’s common on other platforms to need to grab libraries from all sorts of other vendors who each provide varying levels of support, such as an XML library from here, a network library from there.</p>
<p>With .NET, the framework is fairly complete and fully supported. Security updates can be applied automatically without having to check five different places. The platform itself is very secure, scalable, and highly performant.</p>
<p>Not to mention that the tooling built on top of the stack is well integrated and makes development a breeze. Once yours sold on the .NET Framework, ASP.NET MVC will feel very familiar to a PHP or Ruby on Rails developer.</p>
<p>I am also the PM for dynamic languages on ASP.NET. As we bring that towards maturity, Ruby and Python developers will be able to benefit from all the advantages of the .NET Framework while still enjoying their favourite programming language.</p>
<h3>A Bright Future</h3>
<p>It’s clear that some departments within Microsoft are radically changing the way they bring products to market, embracing a more open and inclusive philosophy traditionally seen within the open source community. Will these changes improve the quality of Microsoft products? Will it change the web development community’s negative perception of the company? It’s too soon to tell, but in this little corner of the Microsoft behemoth, feedback seems very favourable.</html></p>
]]></content:encoded>
			<wfw:commentRss>http://www.odd-uk.com/bringing-aspnet-mvc-to-market/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

