MobileFirst, API's, and PaaS - Field Perspective

Certain entities within an Enterprise make a lot of sense to RESTtify. For example an account. It does not take much of a mental leap to create a RESTful service out of an account.

POST to /Account creates an account.GET to /Account/233 retrieves details of account.PUT to /Account/233 updates and accountDELETE to /Account/233 deletes an account.

So then there are actions that do not easily translate. People then drop to some HTTP-RPC thing. An example is when I transfer money from one account to another. A conversation with one of my collegues Brad Bouldin got me thinking about how one might go about RESTfully creating such a service. In an RPC SOA style, I would most likely have something like:

This would be ok if this was a programmatic BPEL process that can propagate transactions, but not in a browser or client tier.

So the transferFund method would have to be a service which in itself is hosted on a server platform, usually on the same App Server that is exposing the account entities. So this would involve a local update.

Now, there is no transferFund verb in REST. Only HTTP methods. So you could use something like JSON-RPC, SOAP, or XML-RPC.

Or you can make a mental switch and consider a Transfer as a noun (or Resource itself). Most likely, besides transferFunds(), you have operations like viewTransfers(), getTransferDetail(), etc...

So fundamentally, the way to create this Facade for Transfer in a RESTful fashion is to make Transfer itself a resource.

POST to /Transfer executes a new Transfer.

You may have a payload with{ accountFrom: '/Account/223',accountTo:'/Account/333',amount:100.00}

a GET to /Transfer/someGeneratedId would return a history of the Transfer record.

PUT could update a Transfer that has not completed, and a DELETE could concel one that has not completed.

REST actually can force a more complete facade which makes you think of 'Auditing' right up front. Specifically for REST services that are resources that map really to some event in the back end.

This does lead to having you to think about navigation between Transfer and Account and forming relationships you might not have thought of. Like an Account Object may have a link to Transfer.

Usually, there is some fundamental namespace that they are under. For example, Customer. You may really have the following:

GET /Customer/custId/Account returns list of accounts for CustomerGET /Customer/custId/Transfer returns list of Transfers for customerGET /Customer/custId/Account/accountId/Transfer returns a list of transfers involving this account

But the semantics can get tricky. What if I want the transfer only involving fromAccount.

I have not written a blog entry in a couple months. To tell you the truth, I struggle with blogging. I consider myself a private person in many aspects of my life. It is funny that my role at work is forcing me to be more 'social' than I would normally be. I like people, don't get me wrong, but the social web takes social skills.

Anyone who knows me knows I can talk one on one. Once I get started, it is hard to shut me up. But in crowds I tend to like to move to the back and observe.

It is funny, when I go to my parents house with my wife and kids, my wife and parents dominate the conversation. I do try to get a word in edge wise, but I find myself out quickly. Part of that is because my Father and Wife just interrupt me. So I have become used to it. I actually leave the room and play with my kids and my sister's kids like a big kid myself.

I started to think about the reason, and I found that the conversation actually does not interest me. They talk about 'so and so' over here, and that person over there, typically called gossiping, which I do not like to do (and the Bible, since I am a Christian, actually discourages it).

So relating that to the 'social web', one can very quickly find that if you are in the wrong community, you may not have much to say. Now, I have a lot to say about Web 2.0, Middleware, etc... so there are other things.

I look at social websites like Facebook. I have an account, with friends. They all post a lot of pictures, send virtual gifts, and other types of applications. I do not like these things too much. First off, I would much rather receive a real gift. Also, I don't like posting pictures of my family. I seem to think the web has a lot of security problems and the pictures wind up in some sick-o site. The status feature is interesting, except, do I want the world to know what I am doing. Though I enjoy reading what others are doing. I have found the scrabble app as cool, and I play a lot with my wife, so that is fun.

I like to share, I try to teach my kids this all the time. But do I want to share what I am doing, or where I am flying?

I think it comes down to is I like to interact with people face to face, I like being around people and listening to them more than talking, and I like to contribute what I know, but not every single thing I am doing. I also like to work in smaller groups of people.

But what about more 'private' people. Maybe they are read only members of the social web.

This is a rant I know, and I am going to post next on a technical topic. But isn't this what blogging is suppose to be about?

Anyway, it takes 'social' skills to be on the social web. This is something I have to work on I guess.