Monday, August 28, 2017

The power of combinatorics, in, well, everything

It was late in the morning (around 5:30 a.m.) by the time Master Foo arrived at the training center.

"I am sorry I am late", he said as he sat down. "I had trouble finding Raw Sienna. It was hidden under my meditation box."

The students looked at each other askance from behind the screens of their laptops. "Raw Sienna? What is that and what has that got to do with developing 21st Century Web Applications using mashup technologies?." The students had paid good money to attend this training course and had lugged their laptops up Pentimenti Mountain the night before to be here. Not to mention the fact that they had risen from their freezing tent beds at 5 a.m. to suit Master Foo's schedule.

"Before we begin looking at the details of mashup application development, I would like to draw you a picture", said Master Foo.

From the countless folds in his robes he proceeded to extract a scroll of paper, a small vial of a clear liquid (presumably water), three artist brushes of varying sizes and 6 small tubes of paint.

"It will be a landscape. Please pay close attention to the mixing of colors."

Over the next twenty minutes, Master Foo created a landscape watercolor painting of the view from the top of Pentimenti mountain. It had a brilliant blue sky created with Cerulean Blue[1] for the lighter parts and Ultramarine[2] for the darker parts. Beneath the sky there were many - perhaps dozens of shades of green used for the trees, bushes and grass. As he worked, Master Foo picked up colors one at a time on his brush and mixed them deftly in small plastic containers.

"Master Foo", one of the students asked, "you have used two types of blue and you sourced them directly from individual tubes of paint. Yet, you have used many shades of green but they are all mixed from other colors. Why is that?"

"How many different greens can you count in my picture?", asked Master Foo.

"I cannot count them exactly, there are many."

"How many types of green did you see on your hike up Pentimenti Mountain?"

"I do not know. A countless number I guess."

"Indeed so.", Master Foo replied. "Now tell me, how many types of application do you envisage building on the Web using mashup technologies in your career?"

"A countless number!", blurted one of the students over the top of his iBook.

"Indeed so.", Master Foo replied, grinning as he again turned his attention to his painting.

"Color mixing is a limitless universe of potentiality. Out of these 6 tubes of paint I can make a limitless number of colors given enough time and creativity. By learning how to use each color both on its own, and in combination with the other colors, my color palette is unlimited."

"The true key to expressive power - in any medium including computing - is combinatorics.", he continued. To the relief of the still baffled students, he also switched on his laptop and Ubuntu sprang into life.

"Now tell me," began Master Foo as he logged in, "what is a mashup really? What is its true nature?"

"It is an exercise in combinatorics!", blurted an eager student. "The power of the mashup concept lies in the ability to combine bits of existing website screens into new website screens."

"Yes and no", said Master Foo, grinning again.

"The true nature of a mashup is indeed combinatoric but not at the level of website screens. A mashup that grabs bits of existing website screens and puts them all on the same screen is just a collection of portlets. A mashup is a deeper integration. It involves grabbing data and grabbing functionality from existing websites to create a brand new website whose functionality is more than the visual sum of its component parts."

"If that is so Master Foo", why have you shown us how to paint a watercolor picture?"

"I have done so because it is an excellent illustration of how not to think about mashup Web applications. An anti-pattern by analogy."

"Ah. So you are saying that we should look deeper than the screens. Look at the data and the functionality that needs to be integrated first. Then worry about creating the visuals of a website?"

"Precisely. Unfortunately, very few developers will bother to do that."

The room fell silent.

"What can be done about that sad situation Master Foo?"

"I do not think anything can be done, I'm afraid. After all, it is fun just to paint pictures! That is their great attraction in Web application design and their great limitation. It is important to note that the term 'mashup' is nothing more than a modern twist on the phrase 'application integration' with all that that involves. Until today's army of young web designers realizes that, we will see a lot of pictures being drawn with nothing but thin white paper underneath them."

The room fell silent again.

"Enough of that sadness", said Master Foo, clapping his hands together. "Let us begin our study of the true route to our salvation which will probably be called mashup 2.0 or something similar. REST is a software architectural style for distributed systems[3]..."