Tuesday, 31 May 2016

A calm API uses situational awareness

In “Now Urbanism” Jan 13, 2011 on Informal Urbanism Celine D’Cruz explains:
“It’s important to look at all these aspects … In 20 years what will the structure look like … what do we have to do to make it simple … it’s not so complex to repair”
This post is part 2 of the series "You don't manage the API, the API manages you", which is a story of my experiences with API's over the last years and by no means a guideline for others.

In my first post, I had argued that the the distributed model of stand-alone API gateways is interesting, because it has some semantics from within the system, but no tools on the market fully support it. While there are some standards, like RFC 5988 and JSON-LD, and some implementations like OData, if you like XML/Atom, JSON API (Katharsis) or HAL/ALPS (Spring Data Cloud), they are very limited and with it limit the use of REST itself.


Monday, 30 May 2016

You don't manage the API, the API manages you

We live lives that are waveforms constantly changing with time, now positive, now negative. Only at moments of great serenity is it possible to find the pure, the informationless state of signal zero.

Kick-Off for a 5-part series on API's

Inspired by a good, simple, API best practices post from Yahoo, I figured it might help to collect all the stuff I've learned in different companies and projects over the last years on API's - anything non-trivial beyond 12 Factor App, Web API Design and Serverless Architecture. For me, API's are the uniform access point to one or multiple systems. For the sake of this article I exclude API's within the same binary here, so you could argue I speak about stand-alone API's if you want (I don't like the term Web API or Front-End API too much).

Stand-Alone API's, and with it Microservices, are being promoted as "SOA, the good parts". Here, an API as front end to multiple systems is lean approach to SOA with right-sized governance, less canonical data models, and a distributed, scalable, containerised, architecture. Quite simply though, they are just a natural evolution of open ecosystems with ubiquitous, uniform HTTP interfaces, propelled by contemporary service-based business models leveraging duck testing for continuous delivery. A good example of such an API is Firebase for instance, a portal to a PaaS.

Over the course of this week I will share a few ideas I stumbled across in the last years. Some of them might have worked, others not, on some I might have worked directly, on others not. This is not a tutorial, this is a story.

Saturday, 2 January 2016

The ephemeral context

Over the holidays, I've read a nice outlook by FJORD and an awesome rant by Maciej. Though the two publications could not be any more different in any sense, they touch on a similar topic:

The re-emergence of context


Back when I was studying mobile application development, it was all about context - changing texts and pictures, structure information, optimize information to location and usage, cram information on a small screen, those things. With responsive, atomic and material design, the focus shifted more and more into grid systems and ordering components efficiently, under the assumption that screens converge so much that all information is equal.

While responsive design works beautifully in many situations, the technical difficulties and trade-offs** superseded the initial idea of contextual design. However, with the "disappearance of apps", context becomes more important than efficient design. With smarter notifications, smart watches, the aggregation of information into other streams and more participatory and collaborative software service usage patterns, giving the right information at the right time becomes the major value proposition. Uber and Airbnb (with new Google Maps ads), Amazon (with Echo), Tinder but really anything that shapes an environment into a service, like IKEA, Google Now (as in Her) or Nest, are on the forefront of this movement. They don't respond to context, they create their own, ephemeral, context.

Reverse CQRS

This means mobility and analytics, in the form of deep learning, merge more and more. Mobility brings its knowledge of context into analytics, turning the flow of applications around. This makes event sourcing the new user interaction, separating the query (as in CQRS) from the command - the event becomes the query, really, and the command, as in the interaction, is executed on an interesting result.

From a service design perspective, this means we need to build stronger mental models, but as concept are harder to reason than to visualize, we need to find a way to explain them better first. We can't just respond to a demand, like opening an app, but must provide different entry points (not just API's) to services, that provide their own feedback loops. Not only, as mentioned above, as entry points via operating system hooks, like notifications. Rather with completely new, independent behaviour, starting from where we see it today for secure logins on a risk basis (e.g. the new Captcha) or proximity-based suggestions. A service design flow looks very different if there is more inputs than outputs. There is a reason SAP looks into interactive programming, and I hope Tesla's ideas for carsharing and using cars for autonomous tasks will soon be reality.

As usual, I believe communication can solve this - call it patterns, guidelines, or I've written about wrong proportion recently, but you need to establish loosely coupled "atomic" interactions, or agents, that can react to "reverse CQRS", like Redux advertises it. The analytics is actually rather straight forward, it could even start with a simple subscription model, but splitting your application flow down will be hard work - especially for all the responsive web apps that used plain old MVC and hard-wired their controllers with the overall flow.

*) Disclaimer: I work for Accenture, which is the parent company of FJORD.
**) I have myself just been on a very service/product-driven software project where we had many of those

Monday, 31 August 2015

9 Books about Architecture

This post is published in December 2015, when I finally found the time to proof read and check. This post is a snapshot of my thinking back at this time.

For a long time, I've had the reading list on the left panel. However, over time it felt a little bit un-curated. Inspired by a list of recent retweets from Jeff Sussna, especially a post by Mike Sall, I thought compiling it differently could make sense.

Let's dive right in - here is my list of 9 (well, actually 12) Architecture Books every interested Software Practitioner should read:

Basic Architecture

These are books that give you an initial understanding of what Architecture is about (hint: something "entirely different") without being to engineering-heavy (if you want that, read Francis D.K. Ching), patronising or historic:

Matthew Frederick, "101 Things I Learned In Architecture School". A small, lovely, extremely simple book that gives you a first glimpse of how to think like an architect.


Doug Patt, "How to Architect". An indexical volume of architectural elements, making it an easy reader and introduction to architecture. Mainly because of his great videos, actually.

Anthony di Mari's "Conditional Design" and "Operative Design". Because it shows the commonalities of structural elements and patterns in building and software architecture in a simple, visual way (as opposed the Alexander's "Pattern Language").

As a bonus: Joel Kotkin, "The City". Not strictly architecture, as it is about urbanism, but a great, short, intense history of human habitat, before you read Jane Jacobs.


Elementary contemporary texts

These are texts that defined contemporary architecture, giving you a feeling of the philosophic foundations of "living and dwelling" - something that is often ignored by engineers talking about architecture.

Robert Venturi, "Complexity And Contradiction In Architecture". Not an easy read, but one of the most defining ones of contemporary architecture. A manifesto against dogma and black and white thinking, introducing the hybrid, notably one of the most often used concepts in IT (often read as counter-example of Le Corbusier's "Towards a New Architecture" and only followed by Bjarke Ingels "Yes is More").

Ram Koolhaas, "Delirious New York". Because it took complexity to the next level, added emergence, and cross-pollination between society and building. Read it as Conway's Law and be astounded. No idea why, after that, it took Architecture so long until Marc Kushner introduced feedback to it.

Kate Nesbitt, "Theorizing a New Agenda for Architecture". An extremely well curated collection of elementary texts that stands out not only as a reader, but for bringing all of those thoughts into a structure that, at least to me personally, was never before so clear.

As a bonus: Fred Brooks' "Design of Design", because it is a software book dealing with architectural design.

Tertiary Literature

Those texts are not directly about architecture, but about the motivations of architecture, it's impact on society and the public.

Adam Sharr, "Heidegger for Architects". Actually the whole "Thinkers for Architects" series is pretty good, and this is just one example. Architects like, and learn, to think from the perspective of other disciplines. Might be a good example for IT.

Stewart Brand, "How buildings learn". Brand is a classic, working on the edge of design thinking/service design since the "Whole Earth Catalog". This is a great introduction into the evolution of buildings and hence an answer to the question: Can architecture emerge?

Geoff Manaugh, "The BLDGBLOG Book". Imho the single best blog about architecture in the interweb, probably the only real alternative to an AA files subscription. The book captures the full spectrum of cutting edge contemporary ideas into one volume.

As a bonus: Jo Steffens', "Unpacking My Library: Architects and Their Books" is a nice tabletop book listing a wide range of architects and their favourite book inspirations - Thomas Pynchon's "Gravity’s Rainbow" is named surprisingly often.

Sunday, 26 July 2015

Documenting Service Interactions

This post is published in December 2015 after I re-read much of Simon Brow's stuff again and figured that, with Structurizr extraction, he is so much on the right way I can stop pondering about that topic - this post is a snapshot of my thinking back in July, which I never really finished due to a unconvincing conclusion.

I’ve actually read "Documenting Software Architecture". ATAM, V&B, DITA and ALM at least ring a bell in my memory. I’ve attended Jazz/RTC, Sparx EA and UML trainings. I can safely say that, in the last 5 years there has barely been a work day I did not use the Atlassian toolchain. Yet, to me it seems there is no truly elegant architecture documentation, let alone knowledge retention, techniques out there in custom software development land.

So why is architecture documentation still so bad?

You have the integrated toolchains on one hand, the legacy of Smalltalk, Lisp Machines, Jazz/RTC/Eclipse/Mylyn and Visual Studio. On the other hand the self-documenting-code and markup world, the legacy of Cobol, like Python, TDD/BDD, Javadoc, Swagger and so on. There are a few attempts to bring the two together, XText, Lighttable, Structure101, and GitHub for that matter, and a few rather academic visual/structural coding systems like Dataflow (e.g. vvvv). Human-understandable documentation, though, still feels like a 2nd class citizen in any larger scale software development ecosystem I am aware of.

The reasons are pretty clear: most documentation systems are either tied to the hip of their very language ecosystem, often as afterthought, and hence not being able to fulfil Polyglot Programming. Or, they have been invented to enforce a given top-down structure, either for waterfall development or as operational support, which is by definition not agile and breaks traceability. Both of these reasons make it tedious to work with documentation. It breaks the flow of feature development, and forces everyone to externalise knowledge into the least common denominator. Hence people named “Architects” or “Business Analysts” still create static documents in more or less nice templates and models, which are outdated the moment they are published, because "the code is the ultimate truth" (unless you do MDD).
That’s a big problem in a digital world. Because software doesn’t just copy real-world business processes, and captures them in a box, anymore. It creates new processes, flows unseen before, that are constantly modified and updated through feedback, until no human understands them anymore. We turn our software into deep learning, minus the human understanding.

Documenting Service Interactions            

At Dockercon, Adrian Cockcroft gave a nice talk about Microservices and how to document the architectural implications. It sounded a little bit like Service/Process Mining, a backwards-looking approach to architecture, more feature/vertical slice/cell rather than layer-based. As such, for me it would fall in the markup bracket from above, a fancier version of Developer Portals in API Management. What I still miss, though, is structure, the levels of abstraction. Not in the UML sense of meta levels, but in the sense of a lean take on views. Without structure, I hate to say it, static documents will never die, and code and architectural documentation will stay detached.

In order to reduce the overhead and eventual detach between code and documentation, we can look at non-architectural documentation, and see how the problem is solved here:
  • Interface and developer documentation, how to use a service or library, can, and should, easily be generated out of code itself (Clean Code meets Convention over Configuration), and versioned directly with it.
  • Traceability to stories can be linked easily, e.g. per check-in. In a post-GitHub world, we must assume this is standard practice.
  • Tests, as behaviour documentation, what is called a specification in BDD, should be versioned and documented with the code, that means aligned to stories and features. Personally speaking I don't think a test can ever cover a real requirement (see below), but it can to certain degree specify a behaviour.
  • Requirements traceability, i.e. feature documentation, is a tricky one, because it typically is orthogonal to stories. This is a vast, separate topic, think MDA, DOORS and Sophist.
  • End-User documentation should be driven by feature documentation, and hence falls in the same area.
  • Integration architecture and dependencies are a bit harder, typically EIP e.g. in IBM Integration Toolkit are used. A bit more lightweight, we could use Adrian’s approach from above. But right now I am not aware of an integrated, structured way to feed back monitoring information into developer documentation (like Hystrix for instance).
  • Operations and maintenance documentation is another tougher step. Even if monitoring on service level is achieved, the impact of infrastructure or database issues is rarely documented and formalised into post mortems that can be simulated. DevOps is a cultural solution, but requires very experienced engineers with tacit knowledge.
  • Information architecture would be a next step, a third dimension to story and requirement, the data view. This is, today, the weakest link.

Aesthetics of Architecture


When documenting architecture, one dives into the aesthetics of code - why something in the world was perceived in a way it deemed necessary to break into into parts of a machine. Which immaterial (as in non-functional) values shaped the design of this machine over time. And why those values were agreed in the first place by the group of authors. Hence, architecture documentation has to become a part of the beauty of code. 

In building architecture, plans have evolved from models and experiments, towards guidelines and procedures. I have mentioned Alberti earlier, also in the first chapter of my book, the inventor of the modern plan as original artwork. In recent years, building architecture has gone back to a much more integrated practise, with plans showing values and ideas rather than processes and concepts. This style has been made popular by Atelier Bow Wow. It enriches architectural section drawings, pushing them almost in the direction of perspective competition drawings*.
Detail from "Graphic Anatomy", Atelier Bow-Wow 2007, Toto Publishers

The myth of the right proportion

Recently, I've been to the Venice Biennale. In one of the exhibition catalogues, Pro Portio, this remarkable passage about the usage of proportions caught my eye:
proportion is [...] investigation of how elements and patterns are connected and interconnected across disciplines [...] universal proportions guide our understanding of creation and the dynamic dance between order and chaos
The art of connecting the different views and perspectives of an architecture, understanding the values that make up our perception of a "good architecture", that's proportion. It's putting the elements of the machine into the right relation to each other. It's the grid in responsive design, the harmony of Pattern Languages, the Fibonacci sequence in planning, Amdahl's law in scalability and, after all, finding the right proportion between documentation and code.

After Venice, we took the chance and drove up to a monument of proportion: Palladio's Villa "La Rotunda", which Colin Rowe called "the ideal villa". It is an example of perfect harmony, as Rowe writes in Architectural Review:
It was not in fact suggested that architectural proportions derived from musical harmonies, but rather that the laws of proportion were established mathematically and universally diffused. The Platonic and Pythagorean universe was compounded of the simpler relationships of numbers, and such a world was formed within the triangle made by the square and cube of the numbers 1, 2, 3

While it stands as an ideal of renaissance proportion, there is an issue: Inside it's absolutely hideous. It's a monument that proves proportions, or patterns, or a grid, can never be the sole source of beauty.

Which might be the reason taking pictures inside is not allowed. For us in software architecture it means while we need to follow a plan, and maybe even make a plan, we need to use proportions as a tool to understand why we made decisions to have relationships established. A 3-tier architecture is not better because it adheres to Fibonacci's sequence or the triangle made by the square. Gregor Hohpe has called this "paying more attention to the lines than to the boxes", or Stefan Tilkov the "Cross-System properties" to care for.

In a wonderful talk, Alvaro Videla hunts down some common myths (a little bit in Bret style). He argues the reason why we still believe them is because they "are easy to repeat and to follow, than to actually learning the whole methodology". Grids, patterns, number laws and thumb rules are myths, as one easily takes ratios for silver bullets instead of guidelines. An example of a myth from the talk is "Miller's Law", the thumb rule of number of elements a human can put in context. Over time, humans have adapted, and the rules need to be changed. It's these changes, and the rules, which is the most important part of documentation. The tradeoffs and their interaction, the timeline, and the change in context and understanding.

I have written about Choice Architecture before. I firmly believe an Architect is a gardener, and as such she needs to work with the seasons, with time, with taste and the weather, to allow emergence (or evolution if you want) of beauty of the plot. Yet it's true, choice needs to be limited, and we require categories and guidelines to make decisions. Taking those decisions, and being able to explain them to others, so they can make them on their plot, is the art of our profession.

*) Architectural drawing style is a wide field, see e.g. Blomfield