Inversion Control – The difference between a library and a framework.

In JavaScript web development, the term web frameworks and library come up ever so often. React for instance is often described as a framework and a library,there have been discussions on whether it’s a library, a framework or both. However, understand…


This content originally appeared on DEV Community and was authored by Jessica-Agorye

In JavaScript web development, the term web frameworks and library come up ever so often. React for instance is often described as a framework and a library,there have been discussions on whether it's a library, a framework or both. However, understanding the difference between a framework and a library lies on a concept called "Inversion of Control" But first, lets define what we mean by framwork, and a library.

Library

JavaScript library is a collection of pre-written javascript code that provides reusable functions and features to help developers build web pages and applications more efficiently. These tools simplifies the
development process , and reduces the need to write certain code from
scratch.

Framework

JavaScript framework is an extensive package that contains HTML,CSS,JavaScript and other technologies. It offers predefined components and patterns that developers can use to write an entire application from scratch more efficiently , while also promoting consistent practices.

The key difference between a library and framework is "inversion control". What does this mean?

When using a library, the developer is in control, deciding how and when to use the library. The developer writes code that calls the library's functions to perform specific task.

When using a framework, the control is 'inverted'.This means the framework calls the developer's code during specific points in it's lifecycle. The framework detrmines the architectiure and flow of the application. In other words every code written by the developer must fit into the structure imposed by the framework.

Finir!


This content originally appeared on DEV Community and was authored by Jessica-Agorye


Print Share Comment Cite Upload Translate Updates
APA

Jessica-Agorye | Sciencx (2024-08-01T16:18:42+00:00) Inversion Control – The difference between a library and a framework.. Retrieved from https://www.scien.cx/2024/08/01/inversion-control-the-difference-between-a-library-and-a-framework/

MLA
" » Inversion Control – The difference between a library and a framework.." Jessica-Agorye | Sciencx - Thursday August 1, 2024, https://www.scien.cx/2024/08/01/inversion-control-the-difference-between-a-library-and-a-framework/
HARVARD
Jessica-Agorye | Sciencx Thursday August 1, 2024 » Inversion Control – The difference between a library and a framework.., viewed ,<https://www.scien.cx/2024/08/01/inversion-control-the-difference-between-a-library-and-a-framework/>
VANCOUVER
Jessica-Agorye | Sciencx - » Inversion Control – The difference between a library and a framework.. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/08/01/inversion-control-the-difference-between-a-library-and-a-framework/
CHICAGO
" » Inversion Control – The difference between a library and a framework.." Jessica-Agorye | Sciencx - Accessed . https://www.scien.cx/2024/08/01/inversion-control-the-difference-between-a-library-and-a-framework/
IEEE
" » Inversion Control – The difference between a library and a framework.." Jessica-Agorye | Sciencx [Online]. Available: https://www.scien.cx/2024/08/01/inversion-control-the-difference-between-a-library-and-a-framework/. [Accessed: ]
rf:citation
» Inversion Control – The difference between a library and a framework. | Jessica-Agorye | Sciencx | https://www.scien.cx/2024/08/01/inversion-control-the-difference-between-a-library-and-a-framework/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.