Skip to main content

Library v/s Framework

 

 

 

 


Library

A library is a functionality grouped and packaged together. A library performs specific, well-defined operations. A library is just a collection of class definitions. The reason is it simply code reuse, in other words, gets the code that has already been written by other developers.
 

Framework

A framework on the other hand more complex. It defines a skeleton where the application defines its own features to fill out the skeleton.


Springboot/Rails are popular framework that deals with complexity of handling http request response cycle. 

Springboot - makes it easy to create stand-alone, production-grade Spring based Applications. 

It is an opinionated framework.

Most Spring Boot applications need minimal Spring configuration.

Rails - is a web application development framework written in the Ruby programming language. 

It is designed to make programming web applications easier by making assumptions about what every developer needs to get started. 

It allows you to write less code while accomplishing more than many other languages and frameworks.



React on the other hand is a popular UI library not a framework.

 
 
When you call a method from a library, you are in control. But with a framework, the control is inverted: the framework calls you.

A framework can contain libraries. A framework will usually include many libraries to make your work easier.

Thank you folks.


Most viewed

Ruby on rails part 6 - Blocks , lambda, procs and closure

 Blocks , lambda, procs  and closure Table of content  1. Blocks 2. Lambda 3. Procs 4. Closure Blocks  Ruby blocks are little anonymous functions that can be passed into methods. Blocks are enclosed in a do-end statement or between brackets {} 
. Blocks can have multiple arguments
. The argument names are defined between two pipe | characters. Blocks are typically used with ‘each’ method which iterates over a list. Syntax of block using {} ['List of items'].each { | block arguments|  block body }  Syntax of block using do-end ['List of items'].each do | block arguments |      # block body end Example of block declared as do-end with each method.   [ 1 , 2 , 3 ].each do |num| puts num end     Output   $ ruby block_with_each.rb 1 2 3 $    Blocks can also be saved in variables or passed as argument to another function.   yield is a Ruby keyword that is used to call a block. When you use the yield keyword, the code inside the block will run. Example of saving a bl