Glenn_CostaRica
1. What is an API?
The acronym âAPIâ stands for the name âApplication Programming Interfacesâ. An API is, basically, a set of code or data that makes it possible for some programs created with some logic in a given language, to interact with a specific system coded in a particular language (that can be different from the language used by those programs that want to interact with it). Formally speaking, the API is defined as âa specification of possible interactions with a software componentâ.
This means an API represents an extra abstraction layer on top of a specific system, that determines how any other system can interact with it. Two systems that interact can be the software that captures an event inside a IoT device and a function in a program in a backend, for example. A typical example can be a system in a server that interacts with a frontend system, or even two different server-side systems.
2. In the article the author compares Java API to Twitter API. What is the main difference between these two APIs?
The Java API is a library of software components. On the other hand, the Twitter API is a web-based JSON API. In the case of the Java API, it determines a series of possibilities of operations and programming of the Java language through internal objects and data structures. In the case of the Twitter API, what is determined is the architecture of the requests and responses that can exist between the server and the client in Twitter.
Thus, in Java, components are made available through the API that implements very useful common resources such as the data structure called âListâ. This structure determines a specification that includes possible interactions such as adding elements, ordering the list, or determining if an element is in the list, among other interactions.
On the other hand, if you compare it, the Twitter API is a very different component, since it is, in itself, a web interface. It is used through HTTP web requests. The API imposes how these requests should be and how the response for a request should be structured, which will usually be in the form of a data package within a JSON type data structure.
3. The section in the article about abstraction is important, try to understand it and write down an abstraction from your daily life.
Abstraction is a technical or technological mechanism that serves to systematize the control that humans have over the complexity of a system, so that, a problem that would seem to require many complex and confusing actions, is divided into several or many layers of simple actions. For each layer, one has a specific protocol or specification on how to interact with the present layer.
Thus, for example, a task that might seem extremely complex for someone who doesnât know Tokyo at all, such as taking the train in Tokyo, can be divided into many stages â layers â so that a person visiting Tokyo for the first time does not miss his/her train or take the wrong train. Each layer will contain a set of possible actions.
A first layer could be this: when entering Tokyo Station, first follow a series of instructions
to decide which line color you should choose. Second layer: after picking your color â your line and your train company â now you have to decide how to buy your ticket. Here you have many options; so you must respect a new set of rules to make the decision. Third layer: after buying the ticket you have to check the protocol in order to get to your platform and to get in line (it is not the same protocol as in the West and remember: if people push you and hit you, it is not exactly rude! Itâs part of social etiquette in this very special circumstance. Donât get mad and donât fight back!)âŚ