Sunday, January 17, 2021

The Nature of the Controller - Idempotency - Apache CABOOSE

Team. It is the case that the term "program", of which a controller is a subclass, has many synonyms. Some of those are module, routine, operation, and function. It is the case that functions have many forms. We call one of these types idempotent. This class of function remains unchanged in behavior when it is composed with itself. For instance the identity function, f(x) = x shows idempotency when it is composed with itself. 

if f(x) = x, show f(f(x)) = x.

f(f(x)) is f(x) by substitution of f(x) = x.

f(x) is x, by the antecedent.

So, f(f(x)) is x, by transitivity.

In general, f(f(...f(x)...)) = x. So, one might compose an idempotent function with itself an arbitrary number of times, and its results will be the same.

So, if a controller is described by a relationship, C(I) = O, where I and O are vectors of zero of more inputs and outputs, respectively, one can take advantage of its idempotence. If one combines this pattern for a general-purpose controller, CABOOSE, with a traditional web-server which is a special-purpose controller, he might produce a "structured" web server. Such a primary process would interact with a bipartite model of page templates and behaviors. And, one might use representational state transfer (REST)-style resource locator for interacting with the controller. The "caboose,py" executable would be invoked implicitly and not be part of the locator string which would list the requested view followed by the input vector.

This is the power of idempotency.

 

No comments:

Post a Comment