Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,153,824 members, 7,820,894 topics. Date: Wednesday, 08 May 2024 at 12:57 AM

The Difference: Framework Versus Library - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / The Difference: Framework Versus Library (1219 Views)

Z-library Is Down. Since 2009 - 2022. Our Beloved Book Library Website Is Gone / Java JDBC Database Object Mysql Connection And Manipulation Library By Antware / Full Time Laravel or Symfony Framework Php/js Developers Are Urgently Needed (2) (3) (4)

(1) (Reply) (Go Down)

The Difference: Framework Versus Library by Olumyco(m): 11:09am On Feb 13, 2019
Framework

Framework can best be explained with the below illustration.

Let's say you are to produce 100 sheets of paper of length 15cm and breath 25cm. The first thing you do is to pick one paper and use ruler to measure 15cm and 25cm and cut the paper into the required length and breadth. When this is done you have produced 1 out of 100 and now remaining 99. How do you produce the remaining 99? Will you continue to measure with ruler repeatedly? I believe you won't want do that. You would simply position the one you have cut on the remaining papers and trace the dimensions out. That is, you use the first one you have cut as a template or model to cut the rest.
The first one you cut is your Framework which you now use to cut others.

Framework is a template or model or architecture that you use to produce a replica of itself.

You would have heard about Angular, backbone, express, socket etc. All these are frameworks.

Like Angular, Backbone, Knockout, Aurelia, Ember etc, they are all MVC/MVVM frameworks for data binding which produces single page applications (SPA).

Like Express, it is a Web server framework for developing server side applications. Also is socket, a framework for developing networking/chatting applications.


Library

Library from its literary meaning is the collection of Books.
You can have multi-purpose library which will have all kinds of books cutting across science to arts to philosophy to so many fields.
You can also have specialized library that will contain only science books or containing only books on Mass Communication and so on. So it depends. We can see that We can have School Library. We can have Faculty Library. We can also have Departmental Library. We can even have specialized field library. Like if I am a computer scientist specialized in Networking I can decide to build a library that will contain only Networking Books.

Now this illustration above too is applicable to Libraries in programming. Libraries in programming are collections of reusable (methods/objects) codes which can be adopted and brought into what one is developing to make one's work easier and faster.

Think of Libraries as Containers containing tools that can be used to help produce something easily.

We have some examples like Jquery, Prototype, Dojo MooTools, modernizr, YUI, and so on. All mentioned are multipurpose libraries.

We have some specialized libraries like scriptaculous which is a library for animation. Dynamic.js library too is a library for animation. Scroll.js is a library for advance scrolling.


The Blur

The difference between Frameworks and Libraries these days is blurry. But here is the major difference.

Framework = Structure + Reusable codes

Library = Reusable codes

Since a framework acts as a template or model for what is produced then we can say it has structure.
Also because you make use of its tools then we can say it has reusable codes.

Library as I said is a container for tools and does not have anything to do with the container (structure) but what is inside it. So libraries are all about reusable methods, properties and co.

Also another thing that is very important and indisputable is what is called "Control".
In a Library you are in charge of the application architecture. You control or dictate the architecture of the application you are developing.
But in a Framework your application architecture is being dictated by the Framework and not you. This is called "Inversion of Control". You are not in control but your Framework.

Furthermore in a library you make calls to methods or functions of the library. But in a framework, the framework makes calls to your own functions written by you. Even when you use framework functions in your codes, you are actually using it to make all that you are developing bend to their own methodologies.

This last point helps us to differentiate btw cunning libraries and framework.

Frameworks dictates the application architecture because you have to follow the structure/manners in which the codes in the frameworks are being organized.
Libraries don't have structures but reusable codes only. But these days some libraries can be cunning and funny to have a little percentage of structure but what you will use to determine it is who dictates the application architecture? Is it you or the library? If it is you then you have used it as a library but if it is the library then it has turned to a framework as a "use case" in your hands.

My Personal Experience

I love jQuery because of its DOM manipulation flavour and Animation skills. I did use it for some of my applications.

There was a time I dabbled into mobile app development and I laid my hands on jquery mobile which is a framework built on top of Jquery library for mobile app development.
...............................

You can read more from here https://www.rhitten.com/#!/rhites/the-difference:-framework-versus-library-007642243426315476
My full personal experience about the library and framework is there.

Thanks
Re: The Difference: Framework Versus Library by Olalekank(m): 12:08pm On Feb 13, 2019
Nice insight
Asides jquery which I don't really like using again, what other framework would you suggest that has that sweet and easy DOM manipulation like jquery
Re: The Difference: Framework Versus Library by harryobas: 3:28pm On Feb 13, 2019
Olumyco:
Framework

Framework can best be explained with the below illustration.

Let's say you are to produce 100 sheets of paper of length 15cm and breath 25cm. The first thing you do is to pick one paper and use ruler to measure 15cm and 25cm and cut the paper into the required length and breadth. When this is done you have produced 1 out of 100 and now remaining 99. How do you produce the remaining 99? Will you continue to measure with ruler repeatedly? I believe you won't want do that. You would simply position the one you have cut on the remaining papers and trace the dimensions out. That is, you use the first one you have cut as a template or model to cut the rest.
The first one you cut is your Framework which you now use to cut others.

Framework is a template or model or architecture that you use to produce a replica of itself.

You would have heard about Angular, backbone, express, socket etc. All these are frameworks.

Like Angular, Backbone, Knockout, Aurelia, Ember etc, they are all MVC/MVVM frameworks for data binding which produces single page applications (SPA).

Like Express, it is a Web server framework for developing server side applications. Also is socket, a framework for developing networking/chatting applications.


Library

Library from its literary meaning is the collection of Books.
You can have multi-purpose library which will have all kinds of books cutting across science to arts to philosophy to so many fields.
You can also have specialized library that will contain only science books or containing only books on Mass Communication and so on. So it depends. We can see that We can have School Library. We can have Faculty Library. We can also have Departmental Library. We can even have specialized field library. Like if I am a computer scientist specialized in Networking I can decide to build a library that will contain only Networking Books.

Now this illustration above too is applicable to Libraries in programming. Libraries in programming are collections of reusable (methods/objects) codes which can be adopted and brought into what one is developing to make one's work easier and faster.

Think of Libraries as Containers containing tools that can be used to help produce something easily.

We have some examples like Jquery, Prototype, Dojo MooTools, modernizr, YUI, and so on. All mentioned are multipurpose libraries.

We have some specialized libraries like scriptaculous which is a library for animation. Dynamic.js library too is a library for animation. Scroll.js is a library for advance scrolling.


The Blur

The difference between Frameworks and Libraries these days is blurry. But here is the major difference.

Framework = Structure + Reusable codes

Library = Reusable codes

Since a framework acts as a template or model for what is produced then we can say it has structure.
Also because you make use of its tools then we can say it has reusable codes.

Library as I said is a container for tools and does not have anything to do with the container (structure) but what is inside it. So libraries are all about reusable methods, properties and co.

Also another thing that is very important and indisputable is what is called "Control".
In a Library you are in charge of the application architecture. You control or dictate the architecture of the application you are developing.
But in a Framework your application architecture is being dictated by the Framework and not you. This is called "Inversion of Control". You are not in control but your Framework.

Furthermore in a library you make calls to methods or functions of the library. But in a framework, the framework makes calls to your own functions written by you. Even when you use framework functions in your codes, you are actually using it to make all that you are developing bend to their own methodologies.

This last point helps us to differentiate btw cunning libraries and framework.

Frameworks dictates the application architecture because you have to follow the structure/manners in which the codes in the frameworks are being organized.
Libraries don't have structures but reusable codes only. But these days some libraries can be cunning and funny to have a little percentage of structure but what you will use to determine it is who dictates the application architecture? Is it you or the library? If it is you then you have used it as a library but if it is the library then it has turned to a framework as a "use case" in your hands.

My Personal Experience

I love jQuery because of its DOM manipulation flavour and Animation skills. I did use it for some of my applications.

There was a time I dabbled into mobile app development and I laid my hands on jquery mobile which is a framework built on top of Jquery library for mobile app development.
...............................

You can read more from here https://www.rhitten.com/#!/rhites/the-difference:-framework-versus-library-007642243426315476
My full personal experience about the library and framework is there.

Thanks

I would define a framework as a reusable chunk of architecture and a library as a collection of related classes or functions(depending on adopted programming paradigm) that are reusable across applications.
Re: The Difference: Framework Versus Library by Olumyco(m): 3:58pm On Feb 13, 2019
harryobas:


I would define a framework as a reusable chunk of architecture and a library as a collection of related classes or functions(depending on adopted programming paradigm) that are reusable across applications.

Nice one.
Re: The Difference: Framework Versus Library by Olumyco(m): 4:01pm On Feb 13, 2019
Olalekank:
Nice insight
Asides jquery which I don't really like using again, what other framework would you suggest that has that sweet and easy DOM manipulation like jquery

For now I dont think there is any that has been able to match jquery oooo. But these days if the framework you are using supports DOM manipulation then one can use the framework's own. Like F7 it comes with its own called DOM7 and it is powerful like jquery
Re: The Difference: Framework Versus Library by Olalekank(m): 4:03pm On Feb 13, 2019
Olumyco:


For now I dont think there is any that has been able to match jquery oooo. But these days if the framework you are using supports DOM manipulation then one can use the framework's own. Like F7 it comes with its own called DOM7 and it is powerful like jquery
Never heard of M7

Anyone who has used jquery and has to use a framework such as angular or React knows what they're missing I swear.

I love my $('jquery')
Re: The Difference: Framework Versus Library by asalimpo(m): 1:48am On Feb 14, 2019
Your explanation of what a framework is,is confusing.
A framewrk is like an uncompleted building. You can build to your taste on the prebuilt structure you acquird but only within certain restrictions. E.g. You cant build a skyscraper on a foundation for a duplex. You can pour d concrete for the pillars but they must b within the structure defined by the mesh of steel rods that hold d concrete. You can use wood or alumium for the window frames but you cant extend d frame space etc. With a framework,you are building off of a preexisting,predefined structure.
With a library,think interms of appliances. When u want to watch a movie/tv,you dont melt plastic nd weld electronics to create one-first rather,you go out nd buy1. Ditto, freezing food, combing ur hair brushng ur teeth etc. You think in terms of using with little or no modifctions to d product acquired. You can swap out a library or even use more than one similar libraries (e.g use different tv's in d same house),but with frameworks, you build on preexisting structures.
Re: The Difference: Framework Versus Library by 3KINGZ18: 7:30pm On Feb 14, 2019
Lol...you explained framework like function
Re: The Difference: Framework Versus Library by CodeTemplar: 7:40pm On Feb 14, 2019
asalimpo:
Your explanation of what a framework is,is confusing.
A framewrk is like an uncompleted building. You can build to your taste on the prebuilt structure you acquird but only within certain restrictions. E.g. You cant build a skyscraper on a foundation for a duplex. You can pour d concrete for the pillars but they must b within the structure defined by the mesh of steel rods that hold d concrete. You can use wood or alumium for the window frames but you cant extend d frame space etc. With a framework,you are building off of a preexisting,predefined structure.
With a library,think interms of appliances. When u want to watch a movie/tv,you dont melt plastic nd weld electronics to create one-first rather,you go out nd buy1. Ditto, freezing food, combing ur hair brushng ur teeth etc. You think in terms of using with little or no modifctions to d product acquired. You can swap out a library or even use more than one similar libraries (e.g use different tv's in d same house),but with frameworks, you build on preexisting structures.
Read what OP posted again. He hit the nail on the head.
Re: The Difference: Framework Versus Library by CodeTemplar: 7:44pm On Feb 14, 2019
A library is like a toolbox. framework is like a customizable foundation you can build upon that is in itself build with help of libraries and other things.
Frameworks are rigid and structural in nature while libraries are modular in nature.
Re: The Difference: Framework Versus Library by asalimpo(m): 3:39pm On Feb 15, 2019
CodeTemplar:
Read what OP posted again. He hit the nail on the head.
He didn't hit the nail on the head to me on his explanation of what a framework is : " " [b] Framework is a template or model or architecture that you use to produce a replica of itself. [\b] . That's not clear at all!
Re: The Difference: Framework Versus Library by CodeTemplar: 5:16pm On Feb 15, 2019
asalimpo:

He didn't hit the nail on the head to me on his explanation of what a framework is : " " [b] Framework is a template or model or architecture that you use to produce a replica of itself. [\b] . That's not clear at all!
He got that right.
Re: The Difference: Framework Versus Library by asalimpo(m): 9:01pm On Feb 16, 2019
CodeTemplar:
He got that right.
yeah! Right. He still left readers scratching their heads wondering what he just said!

(1) (Reply)

Complete Guide To Become A Big Data Engineer In This 2020- Free PDF / How Can I Design And Develop A Game / Please Assist Me In This C Code Challenge!

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 59
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.