Pluralsight Review: Practical IoC With ASP.NET MVC 4

While reading Mark Seemann’s book and after watching Jeremy Clark’s course on dependency injection, I was ready to introduce it in Paskala.  This enthusiasm turned into confusion, oh, about halfway into the project.  I had some ideas about what to do (and admit that I could very well be doing it wrong today), but wasn’t quite sure how to close the loop, so to speak.  This is where John Sonmez’s course on inversion of control in ASP.NET MVC came in handy.  In this course, Sonmez focuses on using an MVC application for his examples; this is in contrast to Clark, who uses WPF.  Sonmez walks through “poor man’s DI” and then discusses Unity and Ninject.  The latter part is particularly useful because I decided to use Ninject in my project, and I really just needed a boost to get started.  I recommend checking out these resources in the same order I did them:  read Seemann’s book, watch Clark’s course, watch Sonmez’s course.

Our franchise savior has arrived!

…Said nobody in reaction to this announcement. Possibly ever in the history of the NFL. Signing Josh McCown for three years is a bit of a head scratcher (even in the NFL, where contracts aren’t guaranteed.) There’s not a lot to recommend him over Brian Hoyer. Take a look at the stats:

Year Age Tm Pos No. G GS QBrec Cmp Att Cmp% Yds TD TD% Int Int% Lng Y/A AY/A Y/C Y/G Rate QBR Sk Yds NY/A ANY/A Sk% 4QC GWD AV
2002 23 ARI 12 2 0 7 18 38.9 66 0 0.0 2 11.1 26 3.7 -1.3 9.4 33.0 10.2 5 50 0.70 -3.22 21.7 0
2003 24 ARI qb 12 11 3 1-2-0 95 166 57.2 1018 5 3.0 6 3.6 60 6.1 5.1 10.7 92.5 70.3 25 174 4.42 3.53 13.1 1 1 3
2004 25 ARI QB 12 14 13 6-7-0 233 408 57.1 2511 11 2.7 10 2.5 48 6.2 5.6 10.8 179.4 74.1 31 263 5.12 4.60 7.1 2 2 7
2005 26 ARI qb 12 9 6 3-3-0 163 270 60.4 1836 9 3.3 11 4.1 49 6.8 5.6 11.3 204.0 74.9 18 101 6.02 4.93 6.3 5
2006 27 DET 12 3 0 0 0 0 0 0 0 0.0 0 0 0
2007 28 OAK QB 12 9 9 2-7-0 111 190 58.4 1151 10 5.3 11 5.8 46 6.1 4.5 10.4 127.9 69.4 27.49 14 92 5.19 3.75 6.9 1
2008 29 CAR 12 2 0 0 0 0 0 0 0 0.0 11.07 0 0 0
2009 30 CAR 12 1 0 1 6 16.7 2 0 0.0 0 0.0 2 0.3 0.3 2.0 2.0 39.6 0.7 1 6 -0.57 -0.57 14.3 0
2011 32 CHI qb 15 3 2 1-1-0 35 55 63.6 414 2 3.6 4 7.3 49 7.5 5.0 11.8 138.0 68.3 30.82 7 43 5.98 3.73 11.3 2
2012 33 CHI 12 0 0 0 0 0 0 0 0 0 0 0
2013 34 CHI qb 12 8 5 3-2-0 149 224 66.5 1829 13 5.8 1 0.4 80 8.2 9.1 12.3 228.6 109.0 85.09 11 37 7.63 8.54 4.7 1 1 8
2014 35 TAM QB 12 11 11 1-10-0 184 327 56.3 2206 11 3.4 14 4.3 56 6.7 5.5 12.0 200.5 70.5 35.71 36 235 5.43 4.30 9.9 4
Career 73 49 17-32-0 978 1664 58.8 11033 61 3.7 59 3.5 80 6.6 5.8 11.3 151.1 76.1 148 1001 5.54 4.74 8.2 4 4 30
4 yrs ARI 36 22 10-12-0 498 862 57.8 5431 25 2.9 29 3.4 60 6.3 5.4 10.9 150.9 72.1 79 588 5.15 4.29 8.4 3 3 15
3 yrs CHI 11 7 4-3-0 184 279 65.9 2243 15 5.4 5 1.8 80 8.0 8.3 12.2 203.9 101.0 18 80 7.28 7.54 6.1 1 1 10
2 yrs CAR 3 0 1 6 16.7 2 0 0.0 0 0.0 2 0.3 0.3 2.0 0.7 39.6 1 6 -0.57 -0.57 14.3 0
1 yr DET 3 0 0 0 0 0 0 0 0.0 0 0 0
1 yr OAK 9 9 2-7-0 111 190 58.4 1151 10 5.3 11 5.8 46 6.1 4.5 10.4 127.9 69.4 14 92 5.19 3.75 6.9 1
1 yr TAM 11 11 1-10-0 184 327 56.3 2206 11 3.4 14 4.3 56 6.7 5.5 12.0 200.5 70.5 36 235 5.43 4.30 9.9 4
Provided by Pro-Football-Reference.com: View Original Table
Generated 2/27/2015.
Year Age Tm Pos No. G GS QBrec Cmp Att Cmp% Yds TD TD% Int Int% Lng Y/A AY/A Y/C Y/G Rate QBR Sk Yds NY/A ANY/A Sk% 4QC GWD AV
2009 24 NWE 8 5 0 19 27 70.4 142 0 0.0 0 0.0 17 5.3 5.3 7.5 28.4 82.6 48.41 2 18 4.28 4.28 6.9 1
2010 25 NWE 8 5 0 7 15 46.7 122 1 6.7 1 6.7 42 8.1 6.5 17.4 24.4 69.3 45.43 0 0 8.13 6.47 0.0 0
2011 26 NWE 8 3 0 1 1 100.0 22 0 0.0 0 0.0 22 22.0 22.0 22.0 7.3 118.7 96.35 0 0 22.00 22.00 0.0 0
2012 27 ARI qb 6 2 1 0-1-0 30 53 56.6 330 1 1.9 2 3.8 53 6.2 4.9 11.0 165.0 65.8 34.57 4 30 5.26 4.04 7.0 1
2013 28 CLE qb 6 3 3 3-0-0 57 96 59.4 615 5 5.2 3 3.1 47 6.4 6.0 10.8 205.0 82.6 47.54 6 48 5.56 5.22 5.9 1 1 1
2014 29 CLE QB 6 14 13 7-6-0 242 438 55.3 3326 12 2.7 13 3.0 81 7.6 6.8 13.7 237.6 76.5 43.08 24 160 6.85 6.11 5.2 4 4 8
Career 32 17 10-7-0 356 630 56.5 4557 19 3.0 19 3.0 81 7.2 6.5 12.8 142.4 76.8 36 256 6.46 5.74 5.4 5 5 11
3 yrs NWE 13 0 27 43 62.8 286 1 2.3 1 2.3 42 6.7 6.1 10.6 22.0 80.2 2 18 5.96 5.40 4.4 1
2 yrs CLE 17 16 10-6-0 299 534 56.0 3941 17 3.2 16 3.0 81 7.4 6.7 13.2 231.8 77.6 30 208 6.62 5.95 5.3 5 5 9
1 yr ARI 2 1 0-1-0 30 53 56.6 330 1 1.9 2 3.8 53 6.2 4.9 11.0 165.0 65.8 4 30 5.26 4.04 7.0 1
Provided by Pro-Football-Reference.com: View Original Table
Generated 2/27/2015.

I’ll wait while you try to find the differences. Let’s see… McCown is more prone to interceptions. He’s also older. McCown gets slightly more yardage per game. That’s about it.

I admit that Hoyer hasn’t done much to impress me. So why get somebody who is an older, worse version of Hoyer? For three years!! The only thing I can think of is that McCown is totally cool with being a backup, while Hoyer still wanted to start. Maybe Coach Flip (FLIPFLIPFLIP) owed McCown a favor. The point is, the signing is a weird one that makes very little sense. If McCown starts as the #1 QB next year, there will be no joy in Cleveland.

Pluralsight Review: Dependency Injection On-Ramp

While reading Mark Seemann’s book on the topic, I decided to watch Jeremy Clark’s series on dependency injection.  I think that the combination of these two resources helped me understand dependency injection a lot better.  Clark starts off with a few sections using “poor man’s DI” to show us dependency injection in the context (primarily) of a WPF application.  One thing I like about this series is Clark’s use of the decorator pattern to implement a caching layer invisible to the rest of the application—this is something I will need to implement in the future and I’m glad I had a nice walkthrough on the topic.

Early Travel To Tampa

My original plan was to travel tomorrow morning to Tampa for SQL Saturday. Nature, apparently, has something else to say about it. The flight I originally had booked has been cancelled due to the threat of 8 inches of snow. Fortunately, I changed the flight this morning to go out tonight, before snow hits Raleigh-Durham. Now we’re just going to see if that flight takes off or if it gets cancelled like all the others.

Given the way the weather looks directly in my flight path, I could see this flight get scrubbed, leaving me a difficult choice of flying in Friday or cancelling. I definitely want to speak at SQL Saturday so I’m rooting for an uneventful trip to the airport.

Unacceptable

SQL injection vulnerabilities were up in 2014.  Sounds like a bunch of product managers need to buy copies of Tribal SQL and read the SQL injection chapter.  Seriously, SQL injection should have died a decade ago and my presentation on the topic should simply have historical value.

On the Anthem breach, Chris Bell is fed up as well.  Check out the comments there for additional insight.  There’s no word yet on the exact nature of the breach, but given the frequency with which data gets out into the wild, someone else will get popped next week.

Pluralsight Review: Play By Play: Azure Deployment With Scott Hanselman

My first Play By Play was a doozy.  In this one, Rob Conery and Scott Hanselman move the This Developer’s Life podcast site to Azure.  I was particularly interested in this because I had just started using Azure myself, so I wanted to see what they did.

Although the nature of this move was different than mine, I still picked up an excellent tip.  For Paskala, I had http://www.paskala.com set up as a CNAME to redirect to my website.  I wanted to do the same with paskala.com but my web host (Webfaction, an excellent host I highly recommend) does not allow the same domain to have a CNAME as well as the ability to handle e-mail.

My hacky solution was to have Webfaction host a tiny site that does a 302 redirect to http://www.paskala.com.  Hanselman’s solution, however, is the correct one:  create an A record pointing to the relevant Azure IP address.  That way, Webfaction handles e-mails to paskala.com but HTTP(S) requests to paskala.com go to Azure and all is well.

This is the big thing I learned from that hour-long talk, and that simple point was absolutely worth the talk for me.  I would also recommend this session to show what a top-notch presentation looks like; the two speakers bounce off of each other really well, but the graphics are incredible and it feels like a film.

What I’m Reading: Code Simplicity

I just finished up Max Kanat-Alexander’s Code Simplicity:  The Fundamentals of Software.  I’m having a difficult time reviewing this book for a couple of reasons.  I liked the concept, the contextual stories (particularly with respect to Bugzilla), and some of the ideas.  Something that struck me as very interesting is the idea that development effort really boils down to the sum of all future effort over the sum of all future maintenance expenditure, and that these future measures generally overwhelm present value and cost.  This was contrary to my prior belief, but after thinking about it some, I can see the argument.  I don’t think it’s quite as clear-cut as Kanat-Alexander makes it out to be, but there is definitely value.

The focus of the book is on simplifying design, and much of the book is an argument for why one should simplify design.  This really feels like it should be the first section of a larger book on design.  I recommend reading the book, but it really isn’t that much longer than, say, a series of blog posts.  This, combined with Kanat-Alexander’s very informal and friendly writing style, made the book almost saccharine in nature:  it’s very sweet but not as filling as you’d want.