A long time ago, I wrote a post about how the interface to your app should be removable – you should be able to lift it off, and have a competent enough API underneath to still work with the app.
eZ publish is very good at this. All their PHP code will run from a command line. Ektron, not so much – to my knowledge, Ektron’s API will only run in the context of the Web server. And they’re not alone – I would say the majority of CMS are like this.
I’m probably nitpicking here, actually. But the ability to run a program outside of the context of the Web server is usually a pretty good indication of the general strength of the API and how it’s been architected.
Written by Magnus Stråle, this allows you to browse an EPiServer content repository from the command line – you can “cd” through the tree, list “files” (really content objects), etc. I played around with it last month at EPiServer’s new digs outside Chicago, and it’s kind of neat.
But…also kind of pointless. I mean, there’s not much you can really do with it, and I’m sure Magnus knew this. In truth, I suspect he wrote it as a semi-comedic exercise – a gee-whiz bit of functionality to show off at a conference.
But, it does demonstrate the point I made two years ago:
When building a new piece of software, you really need to completely divorce the interface from the API. You need to get in the mindset that your app is really just a data store and a set of logic modules that do something. That is your application.
At the same time, you can build an interface that lets a human interact with your application. This an obviously very important piece, so it should get at least as much attention as the application itself. But never forget that the interface is layered on top of the application. In a perfect world, it can be lifted off and thrown away, leaving a fully-functional API underneath.
In that sense, it’s awesome.