Thursday, September 24, 2009

Beyond loose coupling: Completely decoupled agents

In the beginning, a software system was thought of as a process. The process invoked methods to carry out its intended tasks. Both object-oriented and procedural programs are essentially of this nature. The various system components were said to be tightly coupled or integrated.

This view of a software system evolved into one that involved multiple communicating processes, typically by messaging passing. This view reflected a looser coupling between processes and emphasized interoperation between processes via protocols. Traditionally, a protocol specifies the ordering and synchronization constraints upon the sending and receiving of messages by each process.

It is time for another sea change in software systems modeling. Instead of talking in terms of processes, we need to talk in terms of autonomous agents engaging each other. This is only essential given that many of today's Internet applications are services provided by autonomous organizations, and typically involve multiple such organizations. An agent has a legal identity like you and me; properties such as trust, reputation, and responsibility can be attributed to agents. By contrast, a process has no legal identity, and it makes no sense to talk about it in terms of the above properties.

The word 'autonomous' has been much used and abused, and tends to invoke skeptical looks from many and even derision from some. Others conflate it with autonomic. I mean autonomous in the specific sense that no agent has control over another. Autonomy for me is strictly an interagent relation, not between agents and their developers, and it most certainly has nothing to do with intelligent behavior.

Traditional protocols are all about control; therefore, they are not suitable to realize engagements. Engaging means interacting meaningfully. There is nothing meaningful about traditional protocols. The difference between TCP and an e-business protocol such RosettaNet is only in their functionality; not in the nature of their specifications.

To be able to engage, agents have to be coupled only to extent required to interact in a semantically correct manner and no more. Semantic means in general -- for all applications, whether it be banking, supply chain, selling books or anything else. Semantic means at the level of the application.

Commitments yield exactly such a notion of semantic correctness: an agent is interacting correctly as long as it satisfies its commitments. What do we care then whether goods follow payment or payment goods! It's all the same as long as the involved commitments are satisfied!

With commitment-based protocols, agents would be only be nominally coupled, for they would be free to act as they please. An agent could send any message anytime. It would even have the choice of violating its commitments (typically though, there would be penalties for doing that). I prefer to call such agents completely decoupled agents, for they are no more coupled than is absolutely necessary.