KO EN

Framework vs Library vs API

by 민갤

Back End /

pfl.png

Inclusion relationship

Framework

As the word implies, it serves as a skeleton.

  • The developer writes the code to complete the application.

A development environment in which basic frameworks are completed and rules exist.

  • It provides a common development environment.
  • Restrictions arise because it can only be developed in the provided development environment.

Development structure or rules, libraries and toolbars

  • Commonly used libraries are included, allowing applications to be developed quickly.
  • You can reuse code to shorten development time and write consistent code.
  • It simplifies database connectivity and provides a process optimized for network traffic and caching.

Inversion of control (IoC) occurs.

  • The framework controls the overall flow.
  • Since the user only has to write the necessary code in the flow, the number of codes that he or she has to pay attention to is reduced.

example

  • Java: Spring, JUnit
  • Typescript: Angular
  • Python: Django
  • PHP: Laravel

Library

Modularization of functions that can be reused during development

  • There is no environment, only intent and purpose.

The user directly controls the flow of the code.

  • Call and use the necessary code wherever you want.

It provides pretested code for various situations and environments.

  • Lack of support from library developers can lead to compatibility issues for new versions.
  • When used in unsupported environments, wrappers are required, which can affect application performance.

It can reduce the cost of building applications.

  • When you use a library, the code is dependent on that library.You may need to change the code to switch to a new library.
  • Conflicts between libraries may occur and application performance may be degraded.
  • There is a security vulnerability in the library that an attacker can exploit.

example: React, JQuery, AssertJ

API (Application Programming Interface)

Documents that define the rules that must be followed to communicate with other software systems

An interface that allows you to control the functions provided by an operating system or programming language for use in an application.

A system that helps programs interact with them.

example

  • Web API: RESTful API, 기상청 API
  • Social Media API: Facebook Graph API, Twitter API
  • Cloud Service API: Amazon Web Service(AWS) API, Google Cloud Platform(GCP) API, Ncloud API
  • Database API: JDBC

Differences in the process of building a house

Framework: Model House, Floor Plan, Blueprint

  • The structure of the house, such as the location of the kitchen or entrance, the number of rooms, and the location of columns.
  • It should be used as designed by the construction company and cannot be changed by the user.

Libraries: Furniture, Electronics, Tools

  • The interior is freely decorated within the already designed structure (bone).
  • The user has authority over which furniture and materials to buy, assemble, and place.

API: remote control

  • Control the programs to get the desired results.

Reference

https://www.youtube.com/watch?v=_j4u4ftWwhQ

https://cocoon1787.tistory.com/745

https://velog.io/@whitecloud94/프레임워크-vs-라이브러리

https://www.youtube.com/watch?v=yKEwNVbAFC0

https://www.baeldung.com/cs/framework-vs-library

https://webclub.tistory.com/458

https://www.geeksforgeeks.org/software-framework-vs-library

https://anarsolutions.com/libraries-vs-frameworks

https://tibetsandfox.tistory.com/13

Author

민갤

민갤

Back-End Developer

꾸잉꾸잉하고 웁니다.

로그인

디코에 오신 것을 환영해요!
전문가들의 수많은 아티클 창고 🤓