May 14 2012

Entity Framework - So close, but yet so far!

Category: NHibernate | DatabasesMatt @ 14:48

I decided to revisit Entity Framework for a project I’m working on.  It’s been a while since the last time I gave EF a fair shake (way back when it was first released).  I can sum up my impressions of the 4.5 version with a single word: disappointing.  EF has come a very long way since the initial release, no question about that, but there are still so many areas where NHibernate trumps it that I can’t imagine using it for a real production app.  Code First is a pale imitation of Fluent NHibernate, and EF’s schema generation capabilities are very limited compared to what NHibernate can do.  For example, I cannot do something as simple as define a unique key, nor can I incrementally update the schema of an existing database without using migrations.  The only point that I do actually like is the idea of the DbContext as a “gateway” to the database.  I think this would make it easier to enforce aggregate root boundaries when compared to NHibernate’s overly-powerful (and overly-complex) ISession interface. 

Tags:

May 14 2012

See me at devLink 2012!

Category: MiscMatt @ 14:10

I’m going to be attending and speaking at devLink this year!  This will be my first year attending, but I’ve always heard great things about it and I’m very much looking forward to experiencing it first-hand.  And if you can’t catch me at devLink in August, don’t forget that I’ll be at CodeStock next month, too!

Tags:

Apr 30 2012

Musings on SpecsFor 3.0

Category: SpecsForMatt @ 15:59

I’ve been thinking a lot lately about the current short-comings of SpecsFor.  While I’m pretty happy with the end-user experience, the internals have become complex and confused.  I’m also encountering new testing scenarios as I’m writing more and more full integration specs with SpecsFor, and I’m finding that SpecsFor isn’t able to help with those scenarios in the ways I would like for it to.  I have some ideas for SpecsFor 3.0 that I think will simplify the core while also making SpecsFor more flexible and more powerful.

More...

Tags:

Apr 24 2012

Using SpecsFor.Mvc - Dealing with Authentication

Category: ASP.NET | MVC | SpecsFor | TestingMatt @ 15:31

In all of the SpecsFor.Mvc examples I’ve posted so far, I’ve omitted one common cross-cutting requirement of web applications: authentication!  Most web apps have some sort of authentication, and we need to be able to test our core application logic without this cross-cutting concern getting in the way.  SpecsFor.Mvc makes it easy to achieve exactly that, as I’ll show you in this post.

More...

Tags:

Apr 19 2012

Using SpecsFor.Mvc - Reading Data

Category: SpecsFor | TestingMatt @ 16:57

So far in the “Using SpecsFor.Mvc" series, I’ve shown you how to navigate using the strongly-typed API and how to fill out and submit forms.  In part three of my series, I’ll show you how to create automated acceptance tests for your ASP.NET MVC application that verify expected data is displayed on a page. 

More...

Tags:

Apr 16 2012

... are we really arguing about semicolons now?

Category: What NOT To Do | JavaScriptMatt @ 14:40

I know I’m late to the party, but this issue reported in Bootstrap has created quite a stir across the Interwebs and Twitterverse.  Chants of “Down with Semicolons!” by the “JsHipsters” and of “LEARN 2 CODE NEWB” by the “JsVets,” though entertaining, aren’t really doing anyone in the community any good.

More...

Tags:

Apr 15 2012

Introducing MvcDisplayTemplates

Category: ASP.NET | MVC | SpecsForMatt @ 16:00

Beginning with version 2.0, ASP.NET MVC has shipped with a set of templates for both displaying and editing data.  These templates are buried within the System.Web.Mvc assembly.  While you can override them outright, you cannot easily extend them since they’re locked down.  The new MvcDisplayTemplates NuGet package fixes this problems.

More...

Tags:

Apr 9 2012

Random Thoughts

Category: MiscMatt @ 15:16

Here are some random thoughts that have been bouncing around my head for the last couple of days. 

Keep your codebase in a releasable state.  If you are practicing scrum or some other iterative process, make sure your code is releasable at the end of an iteration.  I’m not exactly sure what you do if you’re practicing something like Kanban, but the idea is the same.

Release your application often.  Even if it isn’t to production, go through the process of releasing your code as frequently as you can.  This will force you to design everything to streamline the release process, and it will help identify barriers to releasable code sooner rather than later.

Better yet, automate your releases by practicing continuous deployment.  Even if it is only a release to a lower environment, continuous deployment can be a huge time saver.

One of the best ways to learn a new application and its codebase is through fixing defects.  Unlike new features, which often contain some subjective requirements, defects are usually much more cleanly and tightly defined.  Does that mean that an application with a lot of defects has a shallower learning curve than one with higher quality?

There are few rules in software development, and the answer to any question about software design is “it depends.”  Limiting your abstractions may be the right thing to do, or introducing lots of abstractions might be a better choice.  Sadly, as developers, we have to evaluate each scenario and make the best guess we can with the information at hand.  Then we have to undo that decision 6 to 18 months later when we realize we made the wrong decision.

If it feels more like work than a hobby, You’re Doing It Wrong.  You’re going to spend 8 to 10 hours a day, 5 days a week, “working.”  You better find something you enjoy, or that’s 40-50 hours a week you’re going to spend being miserable.

There.  I feel better now. 

Tags:

Mar 30 2012

SpecsFor.Mvc 1.1 Released

Category: ASP.NET | MVC | Testing | SpecsForMatt @ 14:25

A new release of SpecsFor.Mvc is now live on NuGet.  This release includes one simple, but important, enhancement as well as a few other minor improvements.

More...

Tags:

Mar 29 2012

Using SpecsFor.Mvc - Navigation and Form Submission

Category: SpecsFor | TestingMatt @ 13:58

This is part two of my series on Using SpecsFor.Mvc to write awesome automated acceptance tests for your ASP.NET MVC application.  In this post, we’ll look at navigating around your app from SpecsFor.Mvc and at how to locate, populate, and submit forms. 

More...

Tags: