No further development on Simple.Web

I’ve let this little fact out on Twitter, so here’s a little more detail on why I’m not going to be working on Simple.Web any more.

Original motivation

Whenever people asked why I wrote Simple.Web, I would reply “because Microsoft broke Web API”. Eventually, at an MVP Summit, Scott Hanselman had me stand in front of the Web API development team and explain what it was that they had broken, which was… awkward.

I started writing Zudio when Web API was still “WCF Web API”, being developed by Glenn Block. I think I was using version 0.6. The project had gone quiet, then suddenly re-emerged as ASP.NET Web API 1.0 beta. I switched to the new framework, and everything broke. They’d changed the way IoC/DI worked, they’d added an ApiController base class, and they’d taken out the attribute-based routing, which I’d been a huge fan of.

Here’s the thing about routing. When I create an API, web or otherwise, it is rarely of the type popularised by Ruby on Rails, ASP.NET MVC and most other MVC frameworks. These tend to think of an API as simple resources with HTTP methods – two GETs, a POST, a PUT and a DELETE. That’s not an API. That’s just a basic Data Access Layer over HTTP. Sure, I’ve written code where that is a valid pattern for certain resources, but it’s not an API. An API provides high-level commands and operations, such as “activate this user” or “complete this order”.

The ASP.NET Web API 1.0 release offered the same routing as ASP.NET MVC – “{controller}/{action}/{id}” – and if you wanted anything more complicated, you had to manipulate the routing table directly.

So, I took all the things that I had liked about WCF Web API and put them into Simple.Web. I also added a feature of my own, inspired by a talk I’d seen that week about “Hypermedia As The Engine Of Application State”, where the serialization process would include collections of links so that API consumers didn’t have to hard-code URLs.

Simple.Web also removed the distinction between Views and other types of result, honoured Accept headers, promoted a “Single-Action Controller” pattern, and had a completely asynchronous pipeline.

What’s changed?

Well for a start, Web API 2 has attribute based routing. And it’s got a class-level RoutePrefix attribute that lets you apply routing to a controller; if you then just have a single method (say, “Get”) with an empty Route parameter, you’ve essentially got Simple.Web’s Single-Action Controller pattern.

Web API also has a comprehensive set of hooks and providers and what-have-you that mean you can extend or modify any functionality you like (or don’t like). So the couple of tricks that Simple.Web did, like the link generation, are easy to add in.

And then there’s OWIN, which allows you to integrate functionality into your Web API application at the pipeline level without faffing around with System.Web HttpModules and the like.

Also, Microsoft have changed. Certainly DevDiv. There’s a bunch of awesome people working there, who have been pushing hard for open source ideals across the entire stack, and it’s working. Most of the ASP.NET stack – certainly all the bits I care about – are now developed in the open, and ASP.NET vNext is on GitHub, and accepting pull requests.

ASP.NET vNext was the real trigger, in the end. I am incredibly excited about what’s going on there. A completely new, very lightweight CLR, a modularised base class library distributed via NuGet (just like I asked for), and MVC and Web API combined into a single, cohesive framework. With, incidentally, a fully asynchronous pipeline.

(David Fowler and Damien Edwards were in my Simple.Web talk at NDC London last year. Just sayin’.)

Simple.Web scratched an itch that I had. There is fundamentally no point continuing to scratch an itch that doesn’t itch any more, especially when there’s an over-the-counter cream [metaphor terminated due to potential taste boundary violation].

Seriously, though, I’ve got limited time, and when a mainstream product does everything I need, the way I want it, then I should spend that time creating value instead of replicating other people’s efforts*.

What now, then?

Well, I’m migrating Zudio over to MVC 5.2 & Web API 2.2, which is actually much easier than I expected, and I’ll upgrade that to vNext as soon as there’s a stable release with good performance that I can confidently run on Azure Web Sites.

My AngularJS client-side code relies heavily on the hypermedia links that Simple.Web generates, so I’ve implemented that part of Simple.Web as a Web API extension called Linky, which is on GitHub now and NuGet soon. As and when I find other gaps in Web API or MVC, I will fill them with more extensions. It is my fond hope that simple extensions to the canonical frameworks might be more useful to the wider community than full-blown alternatives.

I will also be doing some blogging (on my coming-soon new blog) about Web API extensions I’ve written that are specific to my project, but where the patterns are broadly applicable.

Finally, I can get back to working on Simple.Data v2 (assuming that Entity Framework v7 isn’t going to add dynamic method-name-based operations).

*PostScript

Just to be clear, this doesn’t mean that I think all alternative web frameworks are a waste of time. Those that offer a completely different approach and philosophy, such as Nancy, obviously bring much-needed innovation and value to the .NET ecosystem. It’s just that Simple.Web doesn’t any more.

Comments

  1. Best of luck Mark, this proves even further that you are a top quality developer- what matters for you is that we have the solutions and tools that we need as developers and that is where you pour in your energy. Keep up the awesome job 🙂

  2. “… (assuming that Entity Framework v7 isn’t going to add dynamic method-name-based operations).”

    I don’t think you have to worry about that one happening 😉

  3. Yeah! Go simple.data 2.0!

  4. Mark,

    Perhaps this is an opportunity to get involved with the ASP.NET vNext project. Whether that’s contributing code or just giving feedback on the general design decision, getting more feedback is never a bad idea.

  5. Excellent news. I love hearing about projects being dropped for this sort of reason.

    I can only hope that one day I can drop Noda Time in the same way 🙂

Trackbacks

  1. […] No further development on Simple.Web (Mark Rendle) […]

  2. […] No further development on Simple.Web – Mark Rendle announces his plans to cease development on Simple.Web, explaining why the projcet existed in the first place, and why he no longer feels it is useful as the core framework includes much of what Simple.Web added. […]

  3. […] No further development on Simple.Web (Mark Rendle) […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: