[RUBY] What exactly is an API?

Premise
This is a summary of what I learned as a programming beginner (1 to 2 months).
It may not work in the actual field, or it may contain mistakes.
If you notice it, I would appreciate it if you could point it out in the comments.

This time, I have summarized the words I heard for the first time, API, as far as I learned.

What is API

Abbreviation for Application Programming Interface It is a certain rule and mechanism used when applications exchange data with each other. The API has an abstract and broad interpretation, and may be used in the following two ways. The first is the meaning of expressing the entire specification that "when a request comes in this way, data is returned in this way". Second, the meaning of "the method that is executed when called" itself The methods that Rails defines and provides, such as link_to and render, are called Rails API.

When actually using it, even if you do not bother to create a program from scratch, if the program created by the predecessor is an API, you can borrow it and use it as part of the web service you develop efficiently. It seems that it is used to proceed with development. To give a concrete example, it seems that google maps are used to access the web page of the restaurant.

Commonly used API

webAPI Refers to the API used using HTTP / HTTPS communication. For example, a map web service called Google Maps is built into another web service. This is achieved by using a Web API called "Google Maps Platform" provided by Google. Google Maps Platform can exchange information such as location information and routes, which eliminates the need to develop the Map part from scratch.

In addition, there are open APIs and internal APIs. The difference between the two is simply the difference in the scope of disclosure, whether it is an API that is open to the public or an API that is used privately, and the concept and content are the same.

Open API

An API that is open to the outside is called an open API (public API). This is exactly what the Google Maps Platform that came out earlier.

Internal API

An API that is handled inside an application developed by the company or an individual. This API is used only for in-house apps and is not open to the public.

Separation of server side and front end

Data is always returned when creating an API, but without a view file, it is not possible to deliver an easy-to-read screen. Therefore, it is necessary to create an application dedicated to the front end separately from the API. In this way, it seems that the development is done by separating the roles of work on the server side and the front end.

Benefits of separation

・ Easy to divide the responsibilities of teams, etc. ・ Because the languages handled are different, you can work efficiently. Front: Markup skills such as HTML and event-driven skills such as JavaScript Server: Skills for handling performance improvements such as computational processing ・ If the data format is unified, even if the language used is changed, only one can be changed.

Deployment to native applications

Native application

An app that can be downloaded from the App Store or Google Play Store using a smartphone or tablet. Basically, the development language is different between iOS and android. iOS:Objective-C,Swift android:Java,Kotlin

Cross platform

Development framework compatible with both iOS and android Flutter and React Native seem to be famous as development languages.

Benefits of APIs in native application development

Using the API is best for native applications. The reason is, for example When creating a web application, an iOS native application, and an android native application If you create one server-side API application, it will be OK. It is a big merit that it is completed by returning appropriate data (API) to each application and implementing the processing for it on the front end (iOS and android), and only one server-side development is required.

Summary

API is a rule or mechanism used when applications exchange data with each other. API is a program that exchanges data on the server side Using the API makes development much easier If you make a server side with API, you can apply it to both iOS and android

Recommended Posts

What exactly is an API?
What is an interface?
What is an initializer?
What is an operator?
What is an annotation?
[Memorandum] What is an error?
[Ruby] What is an instance?
What is Cubby
What is Docker?
What is null? ]
What is java
What is Keycloak
What is maven?
What is Jackson?
What is Docker
What is self
What is Jenkins
What is IM-Juggling?
What is params
What is Facade? ??
What is Java <>?
What is Gradle?
What is POJO
What is Java
What is centOS
What is RubyGem?
What is programming?
What is before_action?
What is Docker
What is Byte?
What is Tomcat
What is Maven Assembly?
What is `docker-compose up`?
What is vue cli
What is Ruby's self?
What is Ruby's attr_accessor?
What is Java Encapsulation?
What is permission denied?
What is instance control?
What is Spring Tools 4
What is Guava's @VisibleForTesting?
What is MVC model?
What is Java technology?
What is Java API-java
What is @ (instance variable)?
What is Gradle's Artifact?
What is JPA Auditing?
[Swift] What is dismiss?
[Java] What is flatMap?
What is a Servlet?
What is web development?
[Java] What is JavaBeans?
[Android] What is Context? ??
[Java] What is ArrayList?
[Ruby] What is true?
What is object-oriented after all?
What is docker run -it?
What is Java Assertion? Summary.
What is DI (Dependency Injection)
What is a wrapper class?
What is object-oriented programming? ~ Beginners ~