I’m a month into our new project and working with a lot of new technologies. When I moved from the desktop back to the web I got some condolences from friends, but it’s always fun to do different things and web development with .Net is much different than when I left. I thought I’d take a timeout from the EF controversy and mention the things that I do like:
- Doing backend development with .Net again. It was interesting(?) to do server side Java last year, but I’m happy to be back.
- Linq for NHibernate. We’re not pushing it that hard, but it’s doing everything I wanted it for. We’re setup to swap out our normal Repository with an InMemoryRepository that relies on Linq to Objects behind the scenes. I think that’s going to end up being huge for testability. I really like being able to put the query logic directly into business layer code instead of being hidden away deep in the bowels of one off Repositories or services — without sacrificing testability in the domain and service layers.
- We’re utilizing some of the new stuff in RhinoMocks 3.5. I love some of the new features like the Arrance, Act, and Assert style testing. We’ve started writing some of our own specific BDD style context superclasses for testing Controllers in the MVC framework, and the new RhinoMocks plays very well into this strategy.
- BDD. I resisted it for awhile because, quoting a friend who shall remain nameless, “TDD, but with ‘Should’ instead of ‘Assert.’” Ok, the shift to “Should” from “Assert” is actually worthy on its own merit, but I think BDD and its concentration on semantics and context is a better way to organize and express tests (specifications). I even think that BDD does really help in the design process.
- The ASP.NET MVC framework is okay. I didn’t like the way it did some things, and I think the testability out of the box isn’t what it could be. However, it was an easy matter to write our own infrastructure on top of the MVC that took the testability pain and some repetitive grunt work away. The fact that it was not only possible, but easy to change its behavior is a major point in the positive column for me on MVC. I love that you can get the code for it too. I don’t think we could have rapidly done the things we did if all we had was Reflector. The things in the MVC that I’m still unhappy with I would blame on ASP.NET in general rather than the MVC itself.
- WatiN for web testing. We’re gambling a bit that its FireFox support is going to be satisfactory, but otherwise, I think WatiN has been exceptionally smooth to use. The fact that it’s callable from .Net code is letting us do some Lambda-fu to closely hook up our tests to the underlying model of the web pages.
- C# 3.5. We’re barely using Linq, but all the features they stuck in there to support Linq are making a huge splash in our code. There are so many times when a judicious extension method eliminates some grunt work or makes code easier to read. Lambda expressions make a lot of code declarative. Object initializers tighten up the code and make unit testing more efficient.