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

<channel>
	<title>Headspring &#187; Jeffrey Palermo</title>
	<atom:link href="http://www.headspring.com/author/jpalermo/feed" rel="self" type="application/rss+xml" />
	<link>http://www.headspring.com</link>
	<description>Custom software... Done right the first time.</description>
	<lastBuildDate>Wed, 16 May 2012 18:27:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2</generator>
	<copyright>Copyright © Headspring 2012 </copyright>
	<managingEditor>marketing@headspring.com (Jeffrey Palermo and Kevin Hurwitz)</managingEditor>
	<webMaster>marketing@headspring.com (Jeffrey Palermo and Kevin Hurwitz)</webMaster>
	<ttl>1440</ttl>
	<image>
		<url>http://www.headspring.com/wp-content/uploads/2012/05/HeadspringFlair144.jpg</url>
		<title>Headspring</title>
		<link>http://www.headspring.com</link>
		<width>144</width>
		<height>144</height>
	</image>
	<itunes:subtitle>We believe there is a better way</itunes:subtitle>
	<itunes:summary>Are you a lifelong learner?  Are you always searching for better ways to develop and maintain software?  So are we!  A passion for learning and growth is a core value at Headspring.  In this podcast, Headspring consultants, programmers, software developers, managers, and executives share the skills, techniques, patterns, and tools that have proven effective on clients&#039; consulting projects.  Headspring is a software consulting company in Austin, TX and has been recognized on the Inc 500 list and the Austin Business Journal&#039;s Best Place to Work award.</itunes:summary>
	<itunes:keywords>headspring, software, line, business, enterprise, applications, custom, MVC, Net, C, database, SQL</itunes:keywords>
	<itunes:category text="Technology" />
	<itunes:category text="Business" />
	<itunes:category text="Education">
		<itunes:category text="Training" />
	</itunes:category>
	<itunes:author>Jeffrey Palermo and Kevin Hurwitz</itunes:author>
	<itunes:owner>
		<itunes:name>Jeffrey Palermo and Kevin Hurwitz</itunes:name>
		<itunes:email>marketing@headspring.com</itunes:email>
	</itunes:owner>
	<itunes:block>no</itunes:block>
	<itunes:explicit>no</itunes:explicit>
	<itunes:image href="http://www.headspring.com/wp-content/uploads/2012/05/HeadspringFlair600.jpg" />
		<item>
		<title>Metrics, reports, KPIs, and the stuff developers must provide to executives</title>
		<link>http://www.headspring.com/2012/04/metrics-reports-kpis-and-the-stuff-developers-must-provide-to-executives</link>
		<comments>http://www.headspring.com/2012/04/metrics-reports-kpis-and-the-stuff-developers-must-provide-to-executives#comments</comments>
		<pubDate>Thu, 12 Apr 2012 04:08:58 +0000</pubDate>
		<dc:creator>Jeffrey Palermo</dc:creator>
				<category><![CDATA[Bonus!]]></category>
		<category><![CDATA[featured]]></category>

		<guid isPermaLink="false">http://www.headspring.com/?p=4808</guid>
		<description><![CDATA[In September of 2007, I joined Headspring as the CTO.  Now I ...]]></description>
			<content:encoded><![CDATA[<p>In September of 2007, I joined <a href="http://www.headspring.com/">Headspring</a> as the CTO.  Now I serve as President and Chief Operating Officer.  When I joined, there were 4 other employees including the original founder serving as CEO.  He founded the company in 2001.  It has always been professional services, but the strategy has changed a few times over the years.  I started my career as a developer in the mid nineties, and now I’m an executive with lots of great developers that I support.  Like most, our company runs on metrics.  As a manager, I understand their worth.  Earlier in my career, I had no idea.</p>
<p>Every day, I glance at our <strong>operational dashboard</strong>.  While I won’t share full screen-shots yet, I want to share some of the graphs I use every day to ensure the company is doing well.  Consider this graph.</p>
<p><a href="http://www.headspring.com/wp-content/uploads/2012/04/CropperCapture22.png"><img style="padding-left: 0px; padding-right: 0px; padding-top: 0px; border-width: 0px;" src="http://www.headspring.com/wp-content/uploads/2012/04/CropperCapture22_thumb.png" alt="CropperCapture[22]" width="540" height="294" border="0" /></a></p>
<p>&nbsp;</p>
<p><span id="more-4808"></span></p>
<p><strong>“BD” stands for “big dial”.</strong>  We have 3 big dials we glance at every day.  If we don’t like what we see, we have some “smaller dials” we can look at.  We use the analogy of a plane cockpit. There are a few things pilots always glance at, and then there are smaller, more detailed ones that are consulted as the need arises.</p>
<p>This graph shows us our utilization breakdown in the categories that are relevant.  Here are the categories:</p>
<ul>
<li><strong>Personal Time</strong>: holidays, vacations, dentist appts, etc.</li>
<li><strong>Assigned Time</strong>: Department meetings, 1x1’s, stand-up meetings, etc</li>
<li><strong>Bench Time</strong>: Time without available project work (doesn’t show because it’s zero)</li>
<li><strong>Other Time</strong>: Unplanned unproductive time, such as having a flat tire on the way to work</li>
<li><strong>Sales Time</strong>: Mostly used by the sales department: work to acquire a client</li>
<li><strong>Billed Time</strong>: self-explanatory</li>
<li><strong>Unbilled Time</strong>: Working for a client, but not charging</li>
<li><strong>CI Time</strong>: Continuous Improvement time:  We expect that our people are working to improve.</li>
<li><strong>Client Time:</strong>  sum of billed and unbilled time.</li>
</ul>
<p>You will notice the big dip during the week of 4/7.  We had our Q1 <strong>quarterly off-site</strong> during that week.  We spent 12% of that week to use as a fun off-site where the entire company toured Inner Space Cavern hundreds of feet under Georgetown.  It shows up on the dashboard because it affects the performance of the company.  As an executive team, we decided it was a good investment in the future productivity of our staff.</p>
<p>You might have also noticed that 4/7 was a Thursday in 2011.  How can it be the week of 4/7?  We use the concept of <strong>“moving weeks”</strong> instead of calendar weeks.  We used to use calendar weeks, but the last data point of the graph was always skewed because it didn’t represent a full data point until people logged their time for Friday.  By taking data from a moving week, when I look at the data on Thursday, it pulls data from the previous Thursday through this Wednesday (yesterday).  That way, every point on the graph represents exactly the same size of a data point.  We do the same for months, quarters and years.</p>
<p><strong>There is a big problem with pull metrics by calendar month (for 2011)</strong>:</p>
<ul>
<li>January has <strong>21</strong> business days</li>
<li>February has <strong>20</strong> business days</li>
<li>March has <strong>23</strong> business days</li>
<li>April has <strong>21</strong> business days</li>
<li>May has <strong>22</strong> business days</li>
</ul>
<p>You can see how using calendar months can <strong>wreak havoc</strong> on the comparability of month metrics.  We expect larger months to pose better numbers than the smaller months.  On the financial side, we have to accrue the payroll appropriately as well in order to keep net income from becoming skewed.</p>
<p>To deal with this, we use the concept of a <strong>moving month</strong>.  There are 13 moving months in a year.  Each moving month is a 28-day time period from yesterday to 28 days before yesterday.  In this way, every data point will be exactly the same size as the other.  There are also 4, 13-week moving quarters in a year.  The following graph is our 2nd big dial shown by moving month.</p>
<p><img src="http://jeffreypalermo.com/files/media/image/Windows-Live-Writer/d066af3fb6f3_8D6C/CropperCapture%5B28%5D_thumb_1.png" alt="CropperCapture[28]" /></p>
<p>Before moving to moving months, the calendar month line was consistently <strong>misrepresented</strong> by the larger months.  Where the line moves, we need to know why.  We made the switch so that every curve of the line was meaningful.  We didn’t want our data communicating falsehoods or April-fools jokes.  You think I’m kidding, but April always looks bad coming straight out of March, which boasts 2 more full business days.  In professional services, a business day accounts for a <strong>significant amount of revenue</strong>.</p>
<p>Using Big Dial 1 and Big Dial 2, we can keep the ship on the right course.  As long as our staff is billing a consistently high percentage: we shoot for 78-79%, and our hourly margins are high enough to account for our unbillable staff (sales, marketing, corporate) and our fixed costs (facilities, supplies, etc.), our company will remain healthy.</p>
<p><strong>These dials are tactical, not strategic</strong>.  The next dial is strategic.</p>
<p><img src="http://jeffreypalermo.com/files/media/image/Windows-Live-Writer/d066af3fb6f3_8D6C/CropperCapture%5B31%5D_thumb.png" alt="CropperCapture[31]" /></p>
<p>This gives us a view into the <strong>structure</strong> of our company.  <strong>We have hired at least 7 new employees since November, 2011</strong>.  With that, it’s important to keep tabs on how we are changing the structure of our company.  When we hired <a href="http://lostechies.com/chrismissal/">Chris Missal</a> for the operations department, we expanded billable staff.  When we hired <a href="http://www.headspring.com/author/mchauvin">Mary Chauvin</a> for marketing, we increased non-billable staff.  Keeping the right balance is important.</p>
<p>You can see that our % of Operations staff to the rest has dipped a little bit over the last 7 months.  We have done that while growing, and we are re-leveling the organization now.  To level out the organization, we need to <strong>add about five more people</strong> to the Operations department.  This graph, while very high level, gives critical insight into how the other two graphs affect our income statement.</p>
<p>Using these three charts together, I have a very good sense of what I need to do to improve the financial performance of the company.  Right now:</p>
<ol>
<li>I need to hire 5 more great .Net developers</li>
<li>I need to keep Client Time at the level of Operations % plus Contractor % (since both types bill)</li>
</ol>
<p>I hope that this helps some developers understand how different types of reports can give answers and perspective to managers.  If a picture is worth a thousand words, shouldn’t more of our reports be pictures?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.headspring.com/2012/04/metrics-reports-kpis-and-the-stuff-developers-must-provide-to-executives/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The confusion around QA: why doesn&#8217;t the industry agree?</title>
		<link>http://www.headspring.com/2012/03/the-confusion-around-qa-why-doesnt-the-industry-agree</link>
		<comments>http://www.headspring.com/2012/03/the-confusion-around-qa-why-doesnt-the-industry-agree#comments</comments>
		<pubDate>Fri, 30 Mar 2012 13:25:37 +0000</pubDate>
		<dc:creator>Jeffrey Palermo</dc:creator>
				<category><![CDATA[frontpage]]></category>
		<category><![CDATA[What the tech?]]></category>

		<guid isPermaLink="false">http://www.headspring.com/2012/03/the-confusion-around-qa-why-doesnt-the-industry-agree</guid>
		<description><![CDATA[Most people in the industry are undoubtedly familiar with the Software Development ...]]></description>
			<content:encoded><![CDATA[<p>Most people in the industry are undoubtedly familiar with the Software Development Lifecycle (SDLC).</p>
<p><img src="http://upload.wikimedia.org/wikipedia/commons/thumb/a/aa/CPT-SystemLifeSycle.svg/500px-CPT-SystemLifeSycle.svg.png" alt="" /></p>
<p>Reference: Wikipedia</p>
<p>I was having lunch with a recruiter colleague, and I was learning about the QA requests from lots of customers.  Most defined the QA role well within the “Testing” oval as shown in the picture.  From my questioning, it appears that the agile movement has done little to alter this SDLC.  In fact, this process is still alive and very will, even within agile teams.  The difference is in the batch size.  Rather than doing analysis on a batch of 50 features and then moving that full batch to design, the agile movement has reduced that batch size considerably, and in some cases reduced it down to a batch size of 1.  Lean agile teams are likely to use a batch size of 1 and continuously pull features through the lifecycle.  As an aside, I find that even when working on a single feature, this cycle is still in play, although the feature is more likely to jump backward and redo a portion of the phase before if new information is found.<span id="more-4508"></span></p>
<p>The reason for the reflection on QA is that my recruiter colleague still predominantly  receives requests for QA folks to fill the roll of the testing phase.  This means that the QA involvement happens after analysis, after design, after implementation, and only when defects can no longer be prevented.  They can only be discovered.  Inspectors at the end of an assembly line are powerless to prevent defective parts.  They can only discover them through inspection and serve a Quality Control role to prevent defective parts from being shipped.  The same is true in software, and many others have written the same.</p>
<p>I shared a very successful project where we incorporated what would otherwise be a very traditional QA Manager into an agile process and yielded great results and a very low defect rate.  When crafting the team’s process, the QA Manager worked in between the analysis and design phases of a given feature to understand and then define the test cases.  That is, based on the current understanding of the feature, how will we test it?  The work required to create the test cases was sufficient to find analysis gaps early and force them to be filled.  The additional information and context contained in the test cases added the design activity as well and yield, in my opinion, a more robust design that was less prone to defects of oversight.  In this project, we saw the time spent coding reduced to less than 50% of the overall project effort.  In fact, at the beginning of the project, programmers were about 50% of project staff, and half-way through, the programmer staff had been reduced to 1/3 of overall project staff.  By crafting a process that pulled thoughts of QA to the beginning of the process, we modified the environment to one in which it was hard for defects to be created in the first place.  In the end, we found no need to create a defect tracking database, and the team was applauded for its quality.  The production launch, which always carries some risk, was a trivial affair, and the system is currently being used by many to perform their daily job.</p>
<p>Our industry stills see QA not as assuring quality, but merely controlling quality through inspection.  Some savvy development managers already have changed traditional QA job descriptions, but there is a long way to go before these notions reach the mainstream of the industry.</p>
<p>What are your experiences with QA?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.headspring.com/2012/03/the-confusion-around-qa-why-doesnt-the-industry-agree/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Onion Architecture: part 4 &#8211; after four years</title>
		<link>http://www.headspring.com/2012/03/onion-architecture-part-4-after-four-years</link>
		<comments>http://www.headspring.com/2012/03/onion-architecture-part-4-after-four-years#comments</comments>
		<pubDate>Thu, 29 Mar 2012 22:04:36 +0000</pubDate>
		<dc:creator>Jeffrey Palermo</dc:creator>
				<category><![CDATA[Developer Deep Dive]]></category>
		<category><![CDATA[architecture]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[onion]]></category>
		<category><![CDATA[patterns]]></category>

		<guid isPermaLink="false">http://www.headspring.com/2012/03/onion-architecture-part-4-after-four-years</guid>
		<description><![CDATA[In 2008, I coined a new pattern name called Onion Architecture.  You ...]]></description>
			<content:encoded><![CDATA[<p>In 2008, I coined a new pattern name called Onion Architecture.  You can read the previous parts here: <a href="http://jeffreypalermo.com/blog/the-onion-architecture-part-1/">part 1</a>, <a href="http://jeffreypalermo.com/blog/the-onion-architecture-part-2/">part 2</a>, <a href="http://jeffreypalermo.com/blog/the-onion-architecture-part-3/">part 3</a>.  Over these four years, I’ve spoken about this pattern at user groups, conferences, and it’s even published in one of the chapters of <a href="http://manning.com/palermo3">ASP.NET MVC in Action</a> from <a href="http://manning.com/palermo3">Manning</a>.</p>
<p>I’ve been overwhelmed by the traction this pattern name has enjoyed.  Folks from all over the country have written about and have talked about the pattern.  Some of the ones I’ve noticed are here (please comment with more – I welcome it).<span id="more-4503"></span></p>
<ul>
<li><a href="http://ayende.com/blog/3464/onion-architecture">Ayende Rahien’s opinion on Onion Architecture</a></li>
<li><a href="http://www.cunningclinton.com/post/2011/07/19/Onion-Architecture.aspx">“Cunning” Clinton’s view</a></li>
<li><a href="http://blog.tonysneed.com/2011/10/08/peeling-back-the-onion-architecture/">Tony Sneed’s view and code sample</a></li>
<li><a href="http://stackoverflow.com/questions/tagged/onion-architecture">StackOverflow questions on Onion Architecture</a></li>
<li><a href="http://chicagoalt.net/event/july-2011-meeting-onion-architecture-with-asp-net-mvc">Matt Hidinger’s Chicago .Net User Group video presentation on OA</a></li>
<li><a href="http://stackoverflow.com/questions/9732747/what-type-of-architecture-is-this-called/9933371#9933371">One interesting StackOverflow question.</a></li>
</ul>
<p>&nbsp;</p>
<p>Back in 2008, I defined four tenets of Onion Architecture:</p>
<ul>
<li><em>The application is built around an independent object model</em></li>
<li><em>Inner layers define interfaces.  Outer layers implement interfaces</em></li>
<li><em>Direction of coupling is toward the center</em></li>
<li><em>All application core code can be compiled and run separate from infrastructure</em></li>
</ul>
<p>&nbsp;</p>
<p>Although there has been significant adoption of this pattern, I have received countless questions about how to implement it in various environments.  I mostly get asked about how it relates to domain-driven design.  First, onion architecture works well with and without DDD patterns.  It works well with CQRS, forms over data, and DDD.  It is merely an architectural pattern where the core object model is represented in a way that does not accept dependencies on less stable code.</p>
<p><a href="http://codecampserver.codeplex.com/">CodeCampServer</a> was an original sample of onion architecture, but it also grew as a sample of how to do ASP.NET MVC in various ways, how to use Portable Areas, and how to use <a href="http://mvccontrib.org">MvcContrib</a> features like input builders.  If you are just looking for onion architecture, it has too much going on.  <a href="https://bitbucket.org/jeffreypalermo/onion-architecture">I have pushed a much simpler solution</a> that represents onion architecture concepts.  I have intentionally not included a UI input form or an IoC container, which most people associate with onion architecture.  Onion architecture works just fine without the likes of StructureMap or Castle Windsor.  Please check out the code here and let me know if this presents a simple approach – that is the goal.</p>
<p>When there is enough interest, I will continue this series with more parts.  CQRS definitely deserves some addressing within this architecture, and so do object models that support task-based UIs.</p>
<p>Get the code <a href="https://bitbucket.org/jeffreypalermo/onion-architecture">here at my BitBucket repository</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.headspring.com/2012/03/onion-architecture-part-4-after-four-years/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Visual Studio Lightswitch, an upgrade path for Microsoft Access to .Net</title>
		<link>http://www.headspring.com/2011/07/visual-studio-lightswitch-and-upgrade-path-for-microsoft-access-to-net</link>
		<comments>http://www.headspring.com/2011/07/visual-studio-lightswitch-and-upgrade-path-for-microsoft-access-to-net#comments</comments>
		<pubDate>Sat, 30 Jul 2011 03:55:46 +0000</pubDate>
		<dc:creator>Jeffrey Palermo</dc:creator>
				<category><![CDATA[Developer Deep Dive]]></category>

		<guid isPermaLink="false">http://www.headspring.com/2011/07/visual-studio-lightswitch-and-upgrade-path-for-microsoft-access-to-net</guid>
		<description><![CDATA[There are lots of business systems written in Microsoft Access.  One of ...]]></description>
			<content:encoded><![CDATA[<p>There are lots of business systems written in Microsoft Access.  One of the most successful companies I know is <a href="http://www.fairsoftware.com/aboutgladstone.aspx">Gladstone, Inc</a>, makers of <a href="http://www.fairsoftware.com/">ShoWorks</a> software.  This software runs most of the county fairs in the U.S.  From entries, to checks, to vendors, this piece of software does it all to help manage and run a fair and keep track of all the data.  And it is written in Access.  Started on Access 97, I have watched this software grow through the various Access upgrades, and it tests the limits of the platform.  It’s author, <a href="http://www.hnatt.com/">Mike Hnatt</a>, is one of the premiere Access gurus, and Microsoft has previous invited him up to the Redmond campus to be a part of internal Software Design Reviews, or SDR’s.  Mike knows the limits of access, but even with the vast array of other development options out there, nothing comes close to parity with the capabilities he relies on – until today.<span id="more-1115"></span></p>
<p><img style="border: 0pt none;" src="http://www.headspring.com/wp-content/uploads/2011/07/image_thumb9.png" alt="Application" width="524" height="333" border="0" /></p>
<p>This is my first <a href="http://www.microsoft.com/visualstudio/en-us/lightswitch">Lightswitch</a> application.  I just installed the software, ran it, defined a table structure and a few screens.  It’s really simple, and I see that i runs a desktop version of Silverlight.  It feels like Access (I have done some of that programming earlier in my career) because you just define the tables and queries, and then ask for screens that work off the data.  You can customize the screens to some degree, and you can write code behind the screens, just like you can write VBA behind Access screens.  This is my first time looking at Lightswitch in a serious way since it was just released.  I will be looking at it more because it belongs in our toolbelt at <a href="http://www.headspring.com">Headspring</a>.  There are plenty of clients who have Access and FoxPro systems.  These systems have tremendously useful built-in functionality that is prohibitively expensive to duplicate in a custom way with raw WPF and C#, but Lightswitch provides a possible upgrade path that won’t break the bank.</p>
<p>In case you are wondering what it looks like to develop this, here it is.</p>
<p><a href="http://www.headspring.com/wp-content/uploads/2011/07/image10.png"><img style="border: 0px;" src="http://www.headspring.com/wp-content/uploads/2011/07/image_thumb10.png" alt="image" width="510" height="304" border="0" /></a></p>
<p>Notice that there is a Solution Explorer, and you are in Visual Studio with a new project type.  I was really pleased that I could write code easily.</p>
<p><a href="http://www.headspring.com/wp-content/uploads/2011/07/image11.png"><img style="border: 0px;" src="http://www.headspring.com/wp-content/uploads/2011/07/image_thumb11.png" alt="image" width="513" height="315" border="0" /></a></p>
<p>I tried some <a href="http://www.jetbrains.com/resharper/">ReSharper</a> shortcuts, but they didn’t work.  I guess we’ll have to wait for ReSharper to enable this project type.  Here is my custom button that shows the message box.</p>
<p><a href="http://www.headspring.com/wp-content/uploads/2011/07/image12.png"><img style="border: 0px;" src="http://www.headspring.com/wp-content/uploads/2011/07/image_thumb12.png" alt="image" width="513" height="302" border="0" /></a></p>
<p>I think Lightswitch as a lot of promise for legacy system rewrites, upgrades, and conversions.  Because it’s 100% .Net, you can mix and match with web services, desktop, SQL Server, etc.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.headspring.com/2011/07/visual-studio-lightswitch-and-upgrade-path-for-microsoft-access-to-net/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to add a method to ViewBag in ASP.NET MVC</title>
		<link>http://www.headspring.com/2011/07/how-to-add-a-method-to-viewbag-in-asp-net-mvc</link>
		<comments>http://www.headspring.com/2011/07/how-to-add-a-method-to-viewbag-in-asp-net-mvc#comments</comments>
		<pubDate>Fri, 29 Jul 2011 19:40:09 +0000</pubDate>
		<dc:creator>Jeffrey Palermo</dc:creator>
				<category><![CDATA[featured]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.headspring.com/2011/07/how-to-add-a-method-to-viewbag-in-asp-net-mvc</guid>
		<description><![CDATA[We are all familiar with the basic HomeController in the default ASP.NET ...]]></description>
			<content:encoded><![CDATA[<p>We are all familiar with the basic HomeController in the default ASP.NET MVC project.  We know we can pass values from the controller to the view.  Sometimes we are tempted to pass the controller itself to the view so that we can call methods on it.  The view should not have to depend on the controller.  This post provides a way to accomplish this.  For more on ASP.NET MVC, check out my book, <a href="http://bit.ly/aspnetmvc3inaction">ASP.NET MVC 3 in Action</a>. <span id="more-1053"></span> You can also check out the <a href="http://info.headspring.com/aspnet-mvc-3-boot-camp/" target="_blank">MVC Boot Camp</a> training we offer at <a href="http://www.headspring.com">Headspring</a>.  We start with the HomeController.</p>
<p><a href="http://www.headspring.com/wp-content/uploads/2011/07/image2.png"><img style="border: 0px;" src="http://www.headspring.com/wp-content/uploads/2011/07/image_thumb2.png" alt="image" width="530" height="403" border="0" /></a></p>
<p>We know from just a little reading that the ViewBag property on HomeController is a dynamic object – using the new .Net 4 dynamic capabilities.  Merely setting the Message property on the object creates the property.  It is not completely obvious how to create a new method on the object, though.</p>
<h1>Usage</h1>
<p>If I were to want to use a method in my Razor view like this. . .</p>
<div class="csharpcode"><a href="http://www.headspring.com/wp-content/uploads/2011/07/image3.png"><img style="border: 0px;" src="http://www.headspring.com/wp-content/uploads/2011/07/image_thumb3.png" alt="image" width="535" height="274" border="0" /></a></div>
<p>. . . then I would need to figure out how to get the GetCurrentTime() method onto the ViewBag.  The following is the solution to that problem.</p>
<h1>Solution</h1>
<p>There are two technical capabilities of C# 4 that provide the ability to accomplish our new method.  The first is that I can create and set any new property on the dynamic object.  The second is actually a feature of .Net 2 – delegates.  I will create a method and then wrap it in a delegate and assign it as a property of ViewBag.</p>
<p><a href="http://www.headspring.com/wp-content/uploads/2011/07/image4.png"><img style="border: 0px;" src="http://www.headspring.com/wp-content/uploads/2011/07/image_thumb4.png" alt="image" width="538" height="344" border="0" /></a></p>
<p>.Net 3.5 brought us the Func&lt;&gt; and the lambda expressions.  These make delegates so much more concise to write and read.  I have now create a method, assigned it to a object and set it as a property on ViewBag.</p>
<p>The only thing left to do is to dereference the property and invoke it with ().</p>
<p>For those of you who have been programming for a while, you know that I technically haven’t create a method on the ViewBag object.  That is correct.  We have to think back to why I asked for the method in the first place.</p>
<h1>Why do we need methods?</h1>
<p>We need methods in order to retrieve values that are resolved at run time.  For instance, if I need to pass in some view-specific value to my ViewBag for evaluation, I need a method. If you were ever tempted to pass a reference to the controller to the view just to be able to execute a method on a value the controller owned, this is your ticket to accomplishing that.  Because the method/closure/delegate in the controller has full scope access to the controller memory space, the ViewBag now holds the gateway to the controller’s state that is necessary.</p>
<p><script type="text/javascript">// <![CDATA[
 (function(){   var hsjs = document.createElement('script');      hsjs.type = 'text/javascript';      hsjs.async = true;      hsjs.src = '//cta-service.cms.hubspot.com/cta-service/loader.js?placement_guid=11aeeb4a-1f2e-49f2-b92a-44e43dc277fa';   (document.getElementsByTagName('head')[0]||document.getElementsByTagName('body')[0]).appendChild(hsjs);   setTimeout(function() {document.getElementById("hs-cta-11aeeb4a-1f2e-49f2-b92a-44e43dc277fa").style.visibility='hidden'}, 1);   setTimeout(function() {document.getElementById("hs-cta-11aeeb4a-1f2e-49f2-b92a-44e43dc277fa").style.visibility='visible'}, 2000); })();
// ]]&gt;</script><br />
<!-- HubSpot Call-to-Action Code --><br />
<!-- hs-cta-wrapper --></p>
<p><span id="hs-cta-wrapper-e69a51f8-bed2-4ae7-9177-0076c05ea1fe" class="hs-cta-wrapper"><br />
<!--HubSpot Call-to-Action Code --><br />
<span id="hs-cta-e69a51f8-bed2-4ae7-9177-0076c05ea1fe" class="hs-cta-node hs-cta-e69a51f8-bed2-4ae7-9177-0076c05ea1fe"><br />
<a href="http://info.headspring.com/asp-net-mvc-3-boot-camp"><img id="hs-cta-img-e69a51f8-bed2-4ae7-9177-0076c05ea1fe" class="hs-cta-img" style="border-width: 0px;" src="//d1n2i0nchws850.cloudfront.net/portals/108832/7df9138b-42c6-4a84-80e2-2032117d73cf-1313701024934/check-out-aspnet-mvc-3-boot-camp.png?v=1313701025.2" alt="check-out-aspnet-mvc-3-boot-camp" /></a><br />
</span><br />
<script type="text/javascript">// <![CDATA[
(function(){
  var hsjs = document.createElement("script");
     hsjs.type = "text/javascript";
     hsjs.async = true;
     hsjs.src = "//cta-service.cms.hubspot.com/cta-service/loader.js?placement_guid=e69a51f8-bed2-4ae7-9177-0076c05ea1fe";
  (document.getElementsByTagName("head")[0]||document.getElementsByTagName("body")[0]).appendChild(hsjs);
  setTimeout(function() {document.getElementById("hs-cta-e69a51f8-bed2-4ae7-9177-0076c05ea1fe").style.visibility="hidden"}, 1);
  setTimeout(function() {document.getElementById("hs-cta-e69a51f8-bed2-4ae7-9177-0076c05ea1fe").style.visibility="visible"}, 2000);
})();
// ]]&gt;</script><br />
<!-- HubSpot Call-to-Action Code --><br />
<!-- hs-cta-wrapper --></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.headspring.com/2011/07/how-to-add-a-method-to-viewbag-in-asp-net-mvc/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Developing ASP.NET MVC with Visual Web Developer Express 2010</title>
		<link>http://www.headspring.com/2011/07/developing-asp-net-mvc-with-visual-web-developer-express-2010</link>
		<comments>http://www.headspring.com/2011/07/developing-asp-net-mvc-with-visual-web-developer-express-2010#comments</comments>
		<pubDate>Fri, 29 Jul 2011 19:24:43 +0000</pubDate>
		<dc:creator>Jeffrey Palermo</dc:creator>
				<category><![CDATA[Developer Deep Dive]]></category>

		<guid isPermaLink="false">http://www.headspring.com/2011/07/developing-asp-net-mvc-with-visual-web-developer-express-2010</guid>
		<description><![CDATA[When the “Express” line of Visual Studio products was introduced with Visual ...]]></description>
			<content:encoded><![CDATA[<p>When the “Express” line of Visual Studio products was introduced with Visual Studio 2008, the Web Developer tool was a one-trick pony.  You could create a web site, and that was pretty much it.  No support for groupings of projects into solutions.  In other words, you couldn’t create libraries at the same time as the web site.</p>
<p>When ASP.NET came on the scene, this posed a problem.  MVC required web application projects, not the web site directory.  Visual Web Developer was enhanced a few times along with the way, and now it is a much more usable package.<span id="more-1045"></span></p>
<h1>Capabilities of Visual Web Developer</h1>
<p>First, you can install Visual Web Developer for free using the Web Platform Installer.  In real terms, don’t try installing it by itself.  You will find yourself tracking down NuGet, SP1, MVC toolkit refresh, etc.  Just go to <a href="http://www.asp.net/vwd">this link to install</a>.</p>
<p><a href="http://www.headspring.com/wp-content/uploads/2011/07/image.png"><img style="margin-left: 0px; margin-right: 0px; border: 0px;" src="http://www.headspring.com/wp-content/uploads/2011/07/image_thumb.png" alt="image" width="442" height="323" align="right" border="0" /></a></p>
<p>After you install and run for the first time, go ahead and create your ASP.NET MVC 3 project.  I selected the “Internet Application” project because it wires up forms authentication for me and gives me a start controller and view.</p>
<p>You can see in this picture that I’m looking at the home controller’s index view that uses the new Razor syntax.</p>
<p>You can also see that the Solution Explorer supports class library projects.</p>
<p>Another new feature of VWD 2010 is that is supports “Extensions”.  This is an extensibility point.  The NuGet package is implemented as an extension.</p>
<p><a href="http://www.headspring.com/wp-content/uploads/2011/07/image1.png"><img style="margin: 0px 5px 0px 0px; border: 0px;" src="http://www.headspring.com/wp-content/uploads/2011/07/image_thumb1.png" alt="image" width="341" height="237" align="left" border="0" /></a></p>
<p>There are many other extensions that can be installed to enhance the capabilities of VWD 2010.  Unfortunately, <a href="http://www.jetbrains.com/resharper/">ReSharper</a> is not one of these.  (By the way, if you haven’t yet installed ReSharper 6, you should do that now.  It provides fabulous support for ASP.NET MVC and Razor views).</p>
<p>At <a href="http://www.headspring.com">Headspring</a>, we still use the full Visual Studio 2010 for custom application development because we really like the extra capabilities, but if you are looking to get started with MVC websites on .Net, go for VWD first.</p>
<p>&nbsp;</p>
<p><span id="hs-cta-wrapper-11aeeb4a-1f2e-49f2-b92a-44e43dc277fa" class="hs-cta-wrapper"><br />
<!--HubSpot Call-to-Action Code --><br />
<span id="hs-cta-11aeeb4a-1f2e-49f2-b92a-44e43dc277fa" class="hs-cta-node hs-cta-11aeeb4a-1f2e-49f2-b92a-44e43dc277fa"><br />
<a href="http://info.headspring.com/aspnet-mvc-3-in-action---excerpt"><img id="hs-cta-img-11aeeb4a-1f2e-49f2-b92a-44e43dc277fa" class="hs-cta-img" style="border-width: 0px;" src="//d1n2i0nchws850.cloudfront.net/portals/108832/8c8e8c94-c1c1-4a11-9f06-d400ca089b92-1321565176985/download-aspnet-mvc-3-in-action-excerpt.png?v=1321565177.25" alt="download-aspnet-mvc-3-in-action-excerpt" /></a><br />
</span><br />
<script type="text/javascript">// <![CDATA[
(function(){
  var hsjs = document.createElement("script");
     hsjs.type = "text/javascript";
     hsjs.async = true;
     hsjs.src = "//cta-service.cms.hubspot.com/cta-service/loader.js?placement_guid=11aeeb4a-1f2e-49f2-b92a-44e43dc277fa";
  (document.getElementsByTagName("head")[0]||document.getElementsByTagName("body")[0]).appendChild(hsjs);
  setTimeout(function() {document.getElementById("hs-cta-11aeeb4a-1f2e-49f2-b92a-44e43dc277fa").style.visibility="hidden"}, 1);
  setTimeout(function() {document.getElementById("hs-cta-11aeeb4a-1f2e-49f2-b92a-44e43dc277fa").style.visibility="visible"}, 2000);
})();
// ]]&gt;</script><br />
<!-- HubSpot Call-to-Action Code --><br />
<!-- hs-cta-wrapper --></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.headspring.com/2011/07/developing-asp-net-mvc-with-visual-web-developer-express-2010/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>From Programmer to Manager</title>
		<link>http://www.headspring.com/2011/07/from-programmer-to-manager</link>
		<comments>http://www.headspring.com/2011/07/from-programmer-to-manager#comments</comments>
		<pubDate>Wed, 27 Jul 2011 15:57:46 +0000</pubDate>
		<dc:creator>Jeffrey Palermo</dc:creator>
				<category><![CDATA[quattro]]></category>

		<guid isPermaLink="false">http://www.headspring.com/2011/07/from-programmer-to-manager</guid>
		<description><![CDATA[I started my career as a programmer. I was fortunate enough to ...]]></description>
			<content:encoded><![CDATA[<p>I started my career as a programmer. I was fortunate enough to get into computing as the Internet revolution was a strong possibility in the early nineties. My career has largely followed the rise of the PC, the Internet, and now cloud computing. Being one of the first on my block with an email address and a web site (which we called &#8220;<a href="http://en.wikipedia.org/wiki/Home_page">home pages</a>&#8221; back then), I started web development very early.<span id="more-893"></span></p>
<h1>In the beginning</h1>
<p>I started my professional programming career as a programmer at the local school district. Some of my software is still running today, and one of their websites for teachers and high school counselors is still online and serving their needs. It&#8217;s written in ASP Classic, but it works well. My first applications used Internet Database Connector technology with ODBC data sources and HTX templates on IIS 2 running on Windows NT 4 servers. As far as I know, this was the birth of the &#8220;code nugget&#8221; in ASP.NET (&lt;% %&gt;). Microsoft <a href="http://msdn.microsoft.com/en-us/library/ms525756(v=vs.90).aspx">still supports this technology</a>.</p>
<p>As my career progressed and I <img src="http://www.headspring.com/wp-content/uploads/2011/07/072711_1557_FromProgram15.png" alt="" align="left" />became more senior as a programmer, I vowed that I would never enter management. After all, I enjoyed coding all day, and I saw some examples of bosses that didn&#8217;t understand the underlying complexities involved in software.</p>
<p>After a few years as a Senior Software Developer, I became interested in not only programming the software that was the solution but also in performing the analysis work to look at a situation and decide the overarching solution.</p>
<h1>The switch</h1>
<p>Later, I became interested in business, and now I am the Chief Operating Officer at <a href="http://www.headspring.com/">Headspring, LP</a>. Headspring is a <img src="http://www.headspring.com/wp-content/uploads/2011/07/072711_1557_FromProgram25.jpg" alt="" align="right" />custom software company in Austin, TX. We help companies compete by helping them get greater value out of their existing custom software investments as well as creating new custom software assets for them. I can see on a daily basis the real operating dollars generated and saved by our software solutions we have deployed for our customers.</p>
<p>My view of the industry has changed quite a bit now that I am a manager. Because Headspring is a custom software company, I still program (everyone does), but I also do the following:</p>
<ul>
<li>Grow our people</li>
<li>Close out monthly financials</li>
<li>Perform financial and operation briefings for the company</li>
<li>Recruit new technical staff</li>
<li>Set compensations levels and promote staff</li>
<li>Manage facilities</li>
<li>Manage vendors</li>
<li>Help set company strategy</li>
</ul>
<h1>Professional development</h1>
<p>We have a learning culture here at Headspring. Everyone is given time for and expected to foster what we call Continuous Improvement. In fact, CI Time is one of the things we track on our time system. Because we are a professional services company, we bill by the hour; therefore, we track every hour.</p>
<p><img src="http://www.headspring.com/wp-content/uploads/2011/07/072711_1557_FromProgram35.gif" alt="" align="left" />In January of 2011, I began a new initiative in my own quest for continuous improvement. I started the MBA program at the <a href="http://www.jwmi.com/">Jack Welch Management Institute</a>. JWMI is a 2-year MBA program started and authored by the long-time CEO of General Electric, Jack Welch. After reading Jack&#8217;s book, <em>Winning</em>, I knew that I could learn a lot from him, and I jumped at the opportunity to apply to be in his Masters of Business Administration program. I have already learned so much about business communication, leadership, strategy, and people management. As a manager, I am seeing that people management might be the most important topic covered in the program.</p>
<h1>What&#8217;s next?</h1>
<p>As a manager, my success depends completely on the work of others, not myself. The only way I succeed is if others succeed. That&#8217;s the big difference between hands-on work and management work. People decisions can make or break an outcome. I have learned a great deal since entering management five years ago. I also know that I have so much more to learn. I am grateful for a terrific staff. They constantly challenge me to find other great people they can work with, and I do that to the best of my ability.</p>
<p>The more I learn, the more I discover how much there is to learn.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.headspring.com/2011/07/from-programmer-to-manager/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Served from: www.headspring.com @ 2012-05-18 12:41:57 -->
