In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly shows you "what is API", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "what is API" this article.
What is API?
As long as we are programming, we need to design API constantly.
Simply put, API can be a calling function, an interface.
Abstractly, an interface is all the information that a cohesive system exposes to the outside world, including but not limited to:
Calling mode
For example, through the lib library or http interface.
Calling convention
Such as lib's function signature or HTTP parameters, http method or header information, long and short links, and so on.
Dependency relationship
For example, the call to the interface needs to involve a third party or other preparatory work, and so on.
API is like a person, we need to know this person's characteristics and preferences when dealing with an API, some people are easy to get along with, while others are very troublesome, especially when you have to deal with him, like people, if you have to deal with him, it is very painful to change his nature, and so is API. Once released, the cost to change is very big.
A good API should have:
Easy to learn
It is easy to use even if there is no documentation.
Not easy to misuse
This is important to reduce the mental burden on users.
Easy to meet demand
The completeness and orthogonality of API. Can easily meet the requirements, completeness to ensure the integrity of the function, orthogonality to ensure the simplicity of the interface, do not need to provide interfaces for all requirements, but by the user to combine.
Easy scalability
How to design a well-designed API?
Single-minded
The function of an API should be single, and it needs to be easy to explain and understand, so it will be easier to use.
As small as possible
Small has many advantages and is easy to understand and maintain.
Minimize external dependence
Reduce the cost of users.
The design is not affected by implementation.
Do not disclose implementation details to users, which may expose less than internal details. Try not to release unnecessary interfaces, such as not using too many functions, without exposing interfaces for the time being.
Good naming
Try to describe yourself.
Complete documentation
Consider performance
The above is all the contents of this article "what is API?" thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.