Blog Image

Personal API Experience

Daily musings

Sharing my day to day lessons, ideas and contemplations of architecting, developing and maintaining services (API) in the global marketplace we call the internet.

“Making coffee” to explain APIs and Domains

API Posted on Wed, September 05, 2018 20:08:17

I was invited to a meeting recently, to explain APIs and why they are important for our digital blueprint. I had no idea who the audience was nor their level of understanding of the basics of APIs. So, with no handy deck prepared for the meeting I entered the room, armed with my laptop full of previous presentations.

I was introduced to the team and the scene was set – “we’ve heard about APIs and need to plan to do them next year”. This prompted the obvious question: “does anyone know what an API is?”. Being an honest audience, the response was “no, but we’ve heard they are reusable and will make our life easier when we have them”.

I first explained the simple stuff; that an API is simply a resource made available to a computer in the same way a website is made available to us humans – via an address. Next came the challenging part; time for coffee.

Making coffee is second nature to us, but imagine trying to get a computer to make you some coffee? You have to tell it explicitly what you need done and the more information we give the computer, the more questions may be raised: What is coffee? How much milk? Do you want milk? What is Milk? Where does milk come from? What is a cow? Where do I put the coffee? What do you do with coffee? These are some of the notions we take for granted as humans, because we’ve learnt about coffee. Now, computers can also learn about coffee, but that is a completely different topic; not one we will cover here. Suffice to say, getting a computer to make coffee requires a lot of attention to detail.

So, how do we do this? Well, we do that same thing we do with most problems; we break them down into smaller pieces. Making coffee involves a number of “things”; water, cup, teaspoon, coffee grains, sugar, milk, kettle, etc. Lets call these domains; the ‘coffee grain’ domain, the ‘cup’ domain, the ‘milk’ domain, and so on. Now, we can take each domain and define the attributes (properties) of it. For example ‘milk’; it’s white in colour, is a liquid, is usually cold. The ‘cup’; it’s a solid, it can hold a certain volume, it can hold liquids, it has a handle. Once we have defined these domains and their properties, we can now tell the computer how to use them to make coffee in simple steps.

  1. Boil water in the kettle
  2. Put one teaspoon of coffee in a cup
  3. Put one teaspoon of sugar into the same cup
  4. When the water in the kettle has boiled, pour 200ml of the water from kettle into the same cup
  5. etc.

APIs can be created in the same way. We define the basic domains of the functionality we want to expose as services (another word for API). In our world, these domains could be customer, account, product, transaction, etc. These form the reusable core APIs. Now, we can use these core APIs to do more complex stuff, like creating a payment API (process API) which orchestrate the core APIs.

  1. Authenticate the customer
  2. Get the customers accounts
  3. Select the right account
  4. Create an instruction to pay the customers registered beneficiary from the selected account
  5. Authorise the payment
  6. View the transaction

With these basic core domain APIs we can now perform multiple other processes. Using most of the domains associated with making coffee, I can replace the ‘coffee grains’ domain with ‘tea bag’ domain and have the computer can make me some tea instead.

Photo by Jessica Lewis from Pexels



Why is Collaboration Across IT Teams so Difficult?

Collaboration Posted on Fri, August 31, 2018 13:50:32

Different groups within an IT department will have different agendas and levels of understanding. The Architecture team is sometimes seen as being too hypothetical, while the Delivery team may be seen as being too focused on delivery. This drives a different approach to solving the same problem. The Architecture team may envisage an approach that’s too complicated, while the Delivery team may want to implement an approach that’s overly simplified, but gets the job done quicker. Somewhere in the middle, we need to find the common ground, and maintain the “workable” bigger picture.

So, how do we collaborate given these sometimes disparate ideologies? How does the Architecture team educate the members of the Delivery team on the bigger picture approach and the reasons for it. At the same time, how does the Delivery team communicate with the Architecture team members to share with them their pain points and pressures – driving the direction of the bigger picture to something that this easier to accomplish, or at least evolutionary?

The crux of the matter, I believe is grounding or frame-of-reference. We all have history, ideas, notions, experiences; and these help us interpret the message we receive. As groups, we have different responsibilities and therefore carry different messages; our way of speaking and the vocabulary used is based on those responsibilities and frames-of-reference. In other words, what we are trying to communicate across groups and disciplines may not be received in the way it was intended to be delivered because our frame-of-references are different!

One final view to consider is that of the people. In order for a message to be received and understood by the collective, it is important to ensure the individual understands. And this could be the biggest blocker in proper collaboration. Consider an individual who is the master of what they have been doing for a while; every one listens to them and asks their advice because they are the gurus. This elevates their position of seniority in the team (perhaps virtually) and the perception within the team is that if they (the guru) agrees, then it must be so. This individual could be in the Architecture or the Delivery team. Now, consider the scenario where this individual is being challenged on their specific approach and told they need to re-skill in order to allow the organisation to adopt a new methodology. It will be very hard for this individual to let go of their “guru” status and become a “learner”. These individuals will naturally challenge any change to protect their status and often discourage or confuse the other team members.

Albeit from a delivery perspective, I found this article very interesting: https://medium.freecodecamp.org/we-fired-our-top-talent-best-decision-we-ever-made-4c0a99728fde

Photo by rawpixel.com from Pexels



« Previous