Web API’s have an Identity Problem (In response to and in support of @davewiner)

If you’ll remember, a while back I announced I was implementing RSSCloud on Windows Azure. By and large this is going well and I expect to have a demo up and running soon.

PS. what follows below is based on an email I sent to my Honours Year supervisor at University and some of this will make it into my thesis too.

The RSSCloud API relies on HTTP POST for messages in and out. And I initially thought Windows Communication Foundation was the way to go.

(bear with me, I’m using this to illustrate my point)

Up until now, WCF has been working. However, in order to actually test the RSS Cloud code, I’ve had to have it the WCF Operation Contracts written as a REST service. Its clearly HTTP POST, but its not in the RSSCloud specification. Though arguably, it should be. Why do i say this? Developers should be able to write code they are comfortable with. Whether than is REST or POST or SOAP or its against an WSDL generated API client.

Back to my little problem. So instead of:

[WebInvoke(Method = "POST", UriTemplate = "/ping?url={value}")]

        [OperationContract]

        String Ping(string value);

I had to use:

[WebInvoke(Method = "POST", UriTemplate = "/ping/url/{value}"/)]

        [OperationContract]

        String Ping(string value);

There is a subtle difference. HTTP post uses the query string, where as REST uses the url itself to transmit information.

Sending a HTTP POST to the first method (where the query string is of the form" ?url={value}&port={value}&…..") hangs the test client. The request is accepted, but it never returns. I can’t even debug the method. Using a pure REST url (the second method), things work perfectly.

In order for project as a whole to conform to the project specification (by which I mean the interoperability of the program and its compliance with the HTTP POST methods defined in the RSSCloud specification), being able to accept HTTP POST is paramount.

I spoke to one of my WCF savvy lecturers. Basically he said that there were two ways to doing this: either stick to using a REST. Or encode the url as part of the POST data. Neither of which solve the problem of sticking to the specification and using HTTP Post.

So, I was digging around ASP.Net MVC 2  yesterday. I was building the page that will actually display the posts in a feed on the page. I noticed that the Controller actions that handle the request  (i.e the feed id to get) have a [HttpPost] attribute above them. I’d never really given that much thought until yesterday.

After my little chat, I had a hunch. Using MVC, I simply added a controller action like so:

[HttpPost]

        public RedirectToRouteResult ThePing()

        {

            string url = (string) Request.QueryString["url"];

            url = url.ToLower();

            ……..

And it worked flawlessly. After all my wrestling with WCF configurations and what not, i was actually quite shocked that it worked first time. One of the problems with working with new frameworks is that you keep discovering new things, but only long after you shoud’ve known.

So, to hit the ThePing method above, the url is http://rsscloudproject/Cloud/ThePing?url=….... (obviously this isn’t deployed yet)

Why does this work?

The reason is quite simple: As I understand it, MVC exposes the Request object for you to use directly, while WCF hides this somewhere in the bowels of its inner workings. So, without getting a handle on the Request object, I can’t force WCF to process the query string differently. Hence, WCF was the wrong choice of framework for this.

So my code is now 100% in compliance with the HTTP POST methods defined in the RSSCloud Specification

Now, what does this mean for the WCF REST project?

I’m keeping it as part of the project. It gives a REST interface, and it gives WSDL that developers can use to build against my service.

Not so much the case with REST, but I personally think that the concept of a WSDL is under-represented when it comes to web based APIs. Adding these two additional interfaces to the RSSCloud specification will be one of my recommendations in the final report. I feel strongly that a web based API needs to give developers as many alternative interfaces as possible. Its no fun when you know one way of doing things, but this API is only provided in another.

For example. I wish Smugmug provided a WSDL that I could point Visual studio to and generate a client for.

Both of these situations illustrate a problem among Web API’s.

I wrote a while  back that Bill Buxton’s Mix 10 keynote about designing natural user interfaces, interfaces that respect the abilities and the skills acquired by the user also applies to designers of API’s.

Bill gives this wonderful example of a violin. The violin itself may be worth millions of dollars (if I remember correctly, Joshua Bell paid $4.5 million for his Stradivarius). The bow of the violin for any first violinist in any symphony orchestra is never less than $10,000. Remember these are musicians. They make a pittance. So as a proportion of income, it’s a fortune. But it’s worth it. Why? Because it’s worthy of the skills that those musicians been acquired over decades.

Dave Winer today published a post about Facebook not providing XML API responses. And bemoaning that Twitter is going to do the same. Dave does not want JSON. He wants XML. Why? He feels comfortable with it, and he has to tools to work with it. Clearly the new API changes do not respect Dave Winer and the abilities he has acquired of decades.

I left the following comment:

I totally understand where you are coming from.

On the other hand, tools will always be insufficent. I don’t think .Net, for example, has JSON support built in, either.

Technology moves so fast, as you say, that next week there will be something new and shiny. Developers find themselves in the curious position for having to write for today, but to prepare for next weeks new thing – they have to find a way to straddle that fence between the two. Open Source is not the complete answer to this problem ( its part of it tho).

  • So, API developers have the responsibility to provide for developers.
  • Tool developers (closed or open source) have a responsibility to provide the tools in a timely fashion.
  • And developers have the responsibility to have reasonable expectations for what they want supported.

This is a large and deep problem in the world of web API’s. They don’t have to be Just JSON or Just XML or Just HTTP POST or Just XML-RPC or Just SOAP or Just WSDL. This collection of formats and standards can co-exist.

And co-exist they should. An API should be available to the widest possible cross section of developers, to respect the individual skills that these developers have acquired of years and decades.

Because when you don’t do that, when you don’t respect that, you make people like Dave Winer stop coding against your API.

Bill Buxton: Respect The Skills Acquired By Your Users

Take 30 minutes and watch his keynote appearance: http://live.visitmix.com/MIX10/Sessions/KEY02 (he’s introduced at the 2:13 mark). Its worthwhile.

If you notice the title, you’ll see that it’s slightly different to what Bill Buxton actually said. Bill is a UI designer. UI design is the natural application of his design paradigm.

But it goes deeper than simple UI design.

You see, Bill’s paradigm is that User Interfaces must respect the skill that has been acquired by the user. Since the acquiring of skill is on thing that we all have in common.

Bill gives this wonderful example of a violin. The violin itself may be worth millions of dollars (if I remember correctly, Joshua Bell paid $4.5 million for his Stradivarius). The bow of the violin for any first violinist in any symphony orchestra is never less than $10,000. Remember these are musicians. They make a pittance. So as a proportion of income, it’s a fortune. But it’s worth it. Why? Because it’s worthy of the skills that those musicians been acquired over decades.

Bill was taking purely in terms of User Interfaces. But the application of this paradigm is rather broad.

For instance, lets take developers.

Developers typically end up working with libraries and API’s. We rarely rewrite what Joel Spolsky affectionately calls duct tape code. Like date comparisons and string builders. It’s a brutally Darwinian process in which the libraries and API’s that are most easily used rise to prominence.

Personally, when I write any code, whether it’s an API used by some other code to do processing, or some plumbing for my UI, or even a class definition with functions and parameters, I always think of the way in which this code is going to be consumed. Since the consumer typically dictates what it needs to get out of that API/function/class. At this point, simple abstraction takes over: how can I abstract away processing code such that my consumer code is much easier and cleaner. In this case the User Interface is not pixels on a screen. No, it’s functions and parameters. The consumer code is and should be treated as a fully fledged user of that code.

The premise this blog post started off with was that user interfaces should respect the skill that has been acquired by the user. Of course, code has no appreciation of skill, whether the code is elegant or not has no meaning to the compiler. But you, as the programmer are consuming the service, the function or the API. You have skill. A skilled programmer writes elegant code. He or she draws on a vast reserve of skill and talent even in the most simplest of tasks.

My point is that when you write your API, when you write your function, when you define you class. You want to ask: "How can I help the programmer that programs against this service write elegant code, how can I write an interface that respects the skills acquired"?

let make some practical application of this:

Typically, I find Web services frustrating. I find it frustrating because I can’t just point Visual Studio at a URL and say "this API lives here and I want to use it". WSDL files, where available, make this so much easier because Visual studio will generate either a web or a service reference.

Why do I say this? For me as a programmer, it does not respect my skills to spend hours each day parsing SOAP or XML or JSON results when what I should actually be doing is writing program code. And yes, some of you will say that it takes all the fun out of life. But I want to be able to go off and write code. Program code. Not low level plumbing, specially plumbing that should be automatically generated for me here in 2010.

That’s one of the things that blew me away about Microsoft’s OData protocol. Here’s a URL and BOOM you have data and are ready to program. You don’t even need a WSDL (whether we need yet another data protocol to have this functionality is another question altogether). It respects the skills of the user, namely me, the programmer. It allows me to immediately get on with the business of practising my chosen craft.

It should be noted that I’m not arguing that we never get our hands dirty in the plumbing. Someone has got to do it. And it is essential training for anyone interested in programming, let alone web services.

In some ways writing an interface that respects the skills I have acquired is a meta-function. The better the interface/class/API is, the better my code is going to be: it’s writing code to write code.

Let’s take another aspect. PowerPoint presentations.

This mornings lecture borrowed a slide deck from TechEd 2009. It was about the BizTalk 2009 ESB Toolkit. Now the slides had no relevance to us as programmers. At all. No respect to the skills we have acquired over years or training and practise. Just a lot of SmartArt. (Id argue that BizTalk as a whole shows little or no respect for our skills as programmers). As a result I discovered what talented doodlers there are in my class, and that nobody snores.

But when was the last time you watched a Scott Hanselman presentation? He uses little or no slides. The majority of his talks involve coding in visual studio. Seriously, how much more respect can you have for the skills your audience has acquired? As a result people sit up and pay attention (and that has absolutely nothing to do with Scott’s various attempts at humour).

Want to see what I mean? See this video: Creating NerdDinner.com with Microsoft ASP.NET Model View Controller (MVC) or this one from Mix10:

BEYOND FILE | NEW COMPANY: FROM CHEESY SAMPLE TO SOCIAL PLATFORM

Talking of Scott Hanselman, have you seen his BabySmash WPF app? It’s written for babies. Babies smash your keyboard very much at random. The app takes this input and turns it into colourful animated shapes that move about the screen. Once again, the User Interface shows respect to the skills the user has (or in this case hasn’t) acquired.

Do not misconstrue this as me banging my drum about ease of use. The easiest point and click UI is the one Smith and Wesson developed many years ago. Yet that UI shows absolutely no respect to the skills developed by its users. And BabySmash may be easy to use, but it shows no respect for my skills as a developer.

As it has been said many times, software is hard. It will always be hard. There will always be challenges. But if we respect the skills of the code ninjas that come forth to complete those challenges, we all benefit.

Re: 7 reasons why the Windows 7 Phone is THE iPhone Killer

I thought I’d repost my comment on this fascinating post: 7 reasons why the Windows 7 Phone is THE iPhone Killer – read the post first.

I must say that I am seriously tempted to get a Windows Phone 7 phone. For all the above reasons.

As a developer, the major enticement is the fact that I can write my own apps for the phone for free.

Having an iPhone and an AppleTv, I’m pretty heavily invested into iTunes store content. That is the big thing holding me back. If Microsoft could get their software to authenticate files with Apple’s DRM servers,t his would be the cherry on the top. The media hub is certainly indicative of Microsoft embracing content irrespective of its origin.

Finally, I assume that the phone syncs with Microsoft’s beautiful Zune software. iTunes as a software program is terrible and the Zune software out does it six ways to Sunday. Again, another big plus.

All the above having being said. I’m wondering what apple will do to respond to this. They clearly have a huge task ahead of them. Microsoft is cleverly tapping into the large install base of Windows and Xbox Live games, the large install base of Mesh, the huge install base of visual studio and Silverlight developers and finally, the huge install base of Exchange servers. These are four constituencies that Apple does not have any worthy alternative (unless one counts the pitiful Exchange support in the iPhone).

This is clearly Microsoft playing to its strengths and not its weaknesses. They are playing this on their own rules, on their terms and and on their own turf.

This is why competition works.

I’d thoroughly encourage everyone to go and watch the Mix 10 Keynote on-demand here: http://live.visitmix.com/MIX10/Sessions/KEY01

You’ll see why am so excited about this as a developer.

Finally, while I’m on the subject of Mix 10, go ahead and see UI designer Bill Buxton in the second half of the second keynote here for a truly inspiring speech: http://live.visitmix.com/MIX10/Sessions/KEY02 (he’s introduced at the 2:13 mark)

Codeplex Project Updates

Meant to do this quick rundown a few weeks back.

  • WCF Client Server Chat– No new development. However, I do think that I’ll have a ready to run version to post. No timing on this. But since this is apparently the most popular project here, I’m feeling the pressure.
  • RSSCloudNotify. Yes, there is a bug in the code. Sometimes it makes it through to the server and sometimes not. This project is in active development, it being a part of my honours year project for uni. The current build was a quick test project to get an idea of the scale of the task. So it WILL be re-written properly leveraging the full ASP.Net stack.
  • WHS2Smugmug. This is also under active development, albeit with a hiatus while I complete my last few months at uni. I have definitely not forgotten about this. Currently, its awaiting testing and revising before releasing a beta. (Don’t forget to follow the project on twitter @whs2smugmug)
  • FFNotify – No new development for awhile. But I do plan to fix the bugs in the current revision. Freindfeed is pretty snappy importing blogs now, so this is not exactly high priority (if you feel different, give me a shout).

Naturally, all the above fixes etc (save for RSSCloudNotify) are subject to how things go at uni. Indeed, some of the stuff I will be writing for my honours year project directly translate back to these projects.

These are all projects that I care deeply about. And are projects that I stated to solve my own problems. Unfortunately there are only so many hours in the day 🙂

Thanks for your interest and support.

Roberto

Apple’s App Store ( or NoStore, the way things are going)

Apple’s draconian App store approval process (more like rejection process, currently) needs a share up. Here are a few suggestions to stream line the process.

  1. Reviewers need to have accountability. We have heard of one reviewer accepting and app, but another reviewer rejecting it. Reviewers need to manage an account made up of a number of apps, ensuring that one reviewer handles an app throughout its lifecycle on the store.
  2. There should be two kinds of updates – bug fixes that need to be pushed out STAT and upgrades that add features. Splitting updates up like this is the equivalent of adding a car pool lane. Bug fixes go out immediately, but new features are still reviewed.
  3. This has been suggested before, but I’ll say it again: trusted developers should be given carte blanche.

Managing 100k apps on the store is NOT easy. Apple’s tenacious grip on every single app is unsustainable. It has to give up some of that top make the app store work.

To be clear, I love the app store. I trust Apple that the apps I install aren’t going to brick my phone. Or that hidden features are going to leave me embarrassed when others borrow the phone. That Apps will be well designed and though out.

Apple is trying to preserve the design aesthetic and vision that Steve Jobs had. That is why originally Apple pushed developers to build web apps. And indeed, there are still some web apps around that I use frequently. The Google Reader iPhone page, the Friendfeed iPhone page, etc. Apple never intended that this be the case. The App store mess marrs the otherwise pristine reputation of the iPhone. It is a perpetual thorn in Steve Jobs’ side.

I hope it gets sorted, soon.

Announcing RSSCloud Notify for Windows Live Writer

CloudRSS

I’m developing a project this year around the RSS Cloud protocol.

As a starting point, I’ve written a a short and sweet WLW plugin.

I’ve got it installed locally (eating my own dogfood), mainly cause useful in testing my system once its written.

This may be a bit of a contradiction in terms since wordpress.com already supports RSSCloud (you’ll see a RSSCloud tag in my feed if you view source. It gives the details of the wordpress.com aggregator).

By default it will use Dave Winer’s test server as an endpoint so make sure you change your settings before use.

Its available at codeplex here: http://rsscloudnotify.codeplex.com/

The source is in the repository if anyone wants to look at it.  Its not quite ready for prime time yet. 🙂

Update 17/11/09 Updated to version 1.01

Update on WHS2SmugMug

Back in January i said I’d get back to writing this Windows Home Server Add-In.

Its now June, 6 months later.  For 3 of those months my camera was back at Nikon being repaired. So I took exactly zero pictures during that time. Its now back and I’m bracing myself for the flood of pictures. I carry 26Gb’s worth of memory cards with me, so I nearly always end up over doing it.

Which brings me to the Add-In. I’ve set up a Codeplex page here. And I’ve made a few check-ins. This is not even pre-alpha code. Let me explain.

A few weeks ago, I asked, via Twitter,  Omar Shahine if I could use his Smugmug Uploader code. now I’m a great fan of the Uploader. I’ve used it for every single uploaded to SmugMug.

So Omar kindly emailed me his code.

So what you will find in the Check-ins, should you be brave enough to take look is Omar’s back-end code sans any UI as part of a WCF service. The WCF service is hosted by a Windows Service (imaginatively called “UploadService”). My plan ( cunning or not) is to have the UI in the Console communicate with the uploader process via WCF. There are other methods, but WCF gives me incredible latitude when it comes to moving data back and forth.

So the Home Server Console tab will simply be a UI for uploading stuff. Instead of Remoting in and using Omar’s uploader. This is an intermediate goal.

My ultimate goal is actually to have a “Smugmug” folder and under it a folder for every Smugmug Album in your account. the above mentioned service will monitor those folders for changes and replicate those changes to Smugmug.

So I’m building now with such a convoluted architecture with a view to where i want to get this Add-in to.

So hopefully I can get the Add-in working soon.

I’m a pretty good test case for this, but I will need testers for it.

Watch my twitter account or my FriendFeed account for updates 😉

PS If you’re asking why I’ve not moved blogs yet, I’m waiting for the next Oxite Release first.

Blogging: I need my Mojo back

 

Blogs still have a very important place in the on going conversation. There is no medium quite like it, not even Friendfeed. Like books, blogs are the long form, the canvas on which we write our longer thoughts. Whether we use it for venting or ranting, commenting or telling or just plain writing, blogs are the corner stone of the online presence.

The one blogging tip I’ve consistently found is the “stick to it” rule: find your subject and stick to it. Which, in all honesty is not something I’ve done very well with this blog. There is so much to talk about and comment on and just plain only chat about that it can be easy to lose your focus :).

This is partly due to the fact that I only joined Twitter and Friendfeed recently, both of which are better for the kind of wide ranging discussion i enjoy.

And its also to do with the fact that, originally, this blog was set up at the drop of a hat, without any thought as to where it would go and what I would be doing online. It was almost an experiment with this newfangled thing that had come along. The whole idea was to witness the internet from the driving seat, rather than from the RSS feeds. This was at the dawn the of the social networking age, before Twitter and Facebook. Before a lot of stuff.

But I digress.

So what is my focus?? All things technology related. But as you can see, everyone else covers this far better than I ever could. Politics is too much of a heated subject for me blog about. Photography, one of my new passions in life, and programming (the passion), and music (the classical kind) and books (I joined Goodreads the other day).

My online presence at the moment is spread throughout Twitter, Freindfeed, Delicious and Smugmug. I’m seeing more and more people moving to bring these strands together in one site. This is perfectly logical and its the right thing to do.

A new site, a new blog, a new platform seems to be what I need. Sometimes I think setting up a WordPress blog is a little too easy. When you put the time and effort into the creation of something, you regard it totally differently.

So that what I’m going to do – set up a new site, part of which will include my blog.  And it’ll be me on the web, a personal presence tying together all of these desperate strands. Kind of like Austin’s Jet:

So I’m on the lookout for a new platform on which to run it. .Net is the preferred option, mainly because I can code it. I’ve looked at Oxite closely and the more I play with it the more I like it.

Why the effort?? You see, I enjoy writing. I really do. I don’t have English teachers after me for essays, or books to write. So writing a blog is the next best thing (maybe THE best). There really isn’t any other medium like it.

Now this particular blog will remain. No doubt I will find some use for it, but all that info is staying on line 🙂

I will continue posting here till things are sorted out, its probably some time away in any case.

Windows 7

Yep. I’m writing this from my Windows 7 VM (on Virtual PC 2007 SP2).

Performance wise, The setup inside of the Vm is making it sluggish. But of the gig of RAM its got, its only using 32%. Which is notable. Vista beta 2, on the other hand) on the same machine in a dual boot configuration used up 80% (of one gig of RAM) standing still.

Talking of performance, I’ve backed the VM up to Windows Home Server. It took all of 20 minutes. Which frankly surprised me. given the fact that this was a new OS running under a VM.

So I’m inclined to wonder exactly how similar to Vista is 7, file wise? Since WHS only copies to the server files which it does not have a copy of (or a version of). Or, it could be that 7 is optimised for WHS to backup (Which makes sense on a number of levels, but not to the European Union).

The other thing i notice is the new taskbar. I’ve grown used to the Vista taskbar for some reason or other, but this is a pleasant change. The fact that the  task bar items can be configured to show application names or not, is really neat.

They do, however get confused with the buttons in the Quick Launch bar quite easily.

The UAC logo has changed colour, to yellow and blue, in keeping with the OS colour scheme. The UAC prompts themselves are worded differently.

The absence of a sidebar is nice. And I hope that the performance hit that running Sidebar produced is gone too. Gadgets are still there, just in the background and way less conspicuous.

Its quite a please feel to the whole OS. Does it feel like Vista?? A little. Its familiar territory. But In truth, I’ve yet to explorer the OS thoroughly. So that answer will have to wait.

One thing that is defiantly different is that Google Chrome 1.0 looks different.its a dark Blue instead of alight blue.

Talking of web browsers, i decided to install IE8. Which didn’t install. It didn’t recognize the OS for some strange reason. Must try again cause I hear that a few people have managed to do it.

I must say that I’m impressed enough to be considering upgrading one of my Vista machines to Windows 7.

This Beta 1 makes me look to Beta 2 and Release with a lot of hope that Microsoft have learned their lesson of the Vista Release debacle.

The one thing that no ones said anything much about is the WinFS file system that Vista was supposed to ship.

With Sun’s ZFS redundant file system, Microsoft are lagging behind. Even OSX has ZFS built in ( it has to be enabled with some obscure command line tricks, but its there).

Even if Microsoft released a separate beta version with WinFS, I’d be happy. 

NTFS is old. Time to innovate it.

Back and ready to rock

So I’m back from holiday (Florida – no ride queues and was great).

And I’m raring to go .

To start the year off, WHS4Smugmug development will resume ( after a year of being busy and feeling guilty). There’s a great series of posts on Add-In development on the tentacleBlog:

And I’ll be using them to bootstrap development and hopefully get moving.

One area I’m worries about is the file/folder structure that it’ll pull the photos from and send them to Smugmug.

So I’ll crowdsource this problem. Please leave a comment on how you organise your photo folder. Thanks.

This’ll help me with the 8000 photos I took in Florida.