RESTrospective - Part 1

by Hari in Uncategorized

For the last 10 months or so I have been quite heavily involved in building RESTful server components and I think now is an appropriate time to retrospect on how my own thinking has changed since then.

For the first month or so I really did get this cool new stuff called REST or to put in more succinctly the whole Roy’s Ph.D. thing was not quite palatable leave alone digesting it :)

Sam Ruby’s book certainly helped in getting features of my application delivered in a fairly restful way but the biggest pain was coming to terms with the idea of your components having an Uniform Interface. I had done some XML-RPC and SOAP over the previous year and when compared with it REST seemed very limiting.

The pain is felt more acutely if you are fall into the trap of thinking that your application must do only CRUD and your objects must be devoid of any other behavior. The operation of HTTP’s uniform interface map very well with CRUD operations on your objects but thinking that every object in your system can have only 4 methods on it did make me say “WHAT!!!!!”

Then along came Duncan Cragg (an ex Thoughtworker himself) and I chanced to read his treatise called The RESTful Dialogues. A must read, notwithstanding its terseness, for anyone trying to get some REST. Of all the episodes the one that I found most profound was the discussion on Business Functions

As an Object programmer I was trained to think that each object is a special creature and therefore was blessed with special powers that were bestowed only unto him. So like children, every object is special to its creator. And within the creator lies this great primordial urge to expose the powers of this super child to the whole network AS IS.

And to top it all the Object Oriented in me was spoilt beyond measure with luxuries of turning something into a distributed service just at the click of a mouse in my favorite programming language/IDE. So all in all I was finding it very hard to come to terms with the idea of a unified & consistent network interface for all network components.

So much that I kept arguing saying posting to  ”http://localhost:300/something/do_this” and  ”http://localhost:300/something/do_this_also” and so on was  so much easier way to web scale nirvana (a.k.a ProgrammerConvenience pattern) than understand this whole uniform interface thing.

I was trained by virtue of my experience with monolithic systems in always trying to get my objects to “doSomething” instead of “helping them transform!” or help in “making something so”.


This shift is perhaps what Duncan means when he talks about shifting from the Imperative to the Declarative school of thought .


It feels like there is this fundamental thing that you don’t learn either at school or at work even after spending a lot of time. Its about understanding limitations, on your own! You are never taught to see the limitations of choices you make. We justify and we thus let life ebb away, acting in old ways…


Apologies for the detour.Let me get to the point.


The point is a style may fit well for doing domain objects with rich behavior in a local setting. But when we start unconsciously using this style for building distributed systems we have taken for granted, the appropriateness of this style for a hard problem like distribution. By doing this we have in fact not even acknowledged distribution as an existing problem.


True, habits die hard.


Personally for me without this nearly 15 years old work that has such an unassuming title I would not have understood what distribution is all about.
Creating special purpose behavior is one thing but distributing them is another. Don’t mix the two up with annotations.


More later.

Another miss

by Hari in Design, Technical Judgement

Somewhere I heard the speaker say in a ppt on REST that the guys behind the WS-* specs are ** actually bright ** people but somehow kept missing the point. Here is another proof of this statement.

I think this juggernaut won’t stop until they have made everything that HTTP facilitates also possible through SOAP. Way to go dudes!!

Another feed, another insight

by Hari in Insights

One of the major changes I found after switching to a feed reader was the sharp rise in the number feeds I have ended up subscribing to. Its almost like making new friends. And then Metcalfe’s law takes over to bring more friends,philosophers and guides. I am amazed on looking back at the number and kinds of places on the net that I have visited over the last month or so. Surely I would not have found them myself.

So as I was digging through one publisher’s archives I came across the name of Scott Berkun and a reference to his essay titled Why smart people defend bad ideas.
The title and of course the contents were so interesting that I experienced no deficit of attention or whatsoever :) through my reading session. By the end I had decided to share some intersting points Scott makes.

Playing with words…

But one thing I did learn after years of studying advanced logic theory is that proficiency in argument can easily be used to overpower others, even when you are dead wrong. If you learn a few tricks of logic and debate, you can refute the obvious, and defend the ridiculous. If the people you’re arguing with aren’t as comfortable in the tactics of argument, or aren’t as arrogant as you are, they may even give in and agree with you.

So true…..

Just because everyone in the room is smart doesn’t mean that collectively they will arrive at smart ideas. The power of peer pressure is that it works on our psychology, not our intellect. As social animals we are heavily influenced by how the people around us behave, and the quality of our own internal decision making varies widely depending on the environment we currently are in.

Better consult with caution :)

Some teams of people look to focus groups, consultancies, and research methods to bring in outside ideas, but this rarely improves the quality of thinking in the group itself. Those outside ideas, however bold or original, are at the mercy of the diversity of thought within the group itself. If the group, as a collective, is only capable of approving B level work, it doesn’t matter how many A level ideas you bring to it..

One for your team

If you want your smart people to be as smart as possible, seek a diversity of ideas. Find people with different experiences, opinions, backgrounds, weights, heights, races, facial hair styles, colors, past-times, favorite items of clothing, philosophies, and beliefs. Unify them around the results you want, not the means or approaches they are expected to use.

and one for you

On your own, avoid homogenous books, films, music, food, sex, media and people. Actually experience life by going to places you don’t usually go, spending time with people you don’t usually spend time with. Be in the moment and be open to it.

Part of being a truly smart person is to know which level is the right one at a given time…..People worry about the wrong thing at the wrong time and apply their intelligence in ways that doesn’t serve the greater good of whatever they’re trying to achieve. Some call this difference in skill wisdom, in that the wise know what to be thinking about, where as the merely intelligent only know how to think.

and finally,

The lesson is this: “Speed kills”. I was never very good at pool, but this one guy there was, and whenever we’d play, he’d watch me miss easy shots because I tried to force them in with authority. I chose speed and power over control, and I usually lost. So like pool, when it comes to defusing smart people who are defending bad ideas, you have to find ways to slow things down.