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 4 - Exception Handling

  Ruby on Rails Part 4 - Exception Handling  Table of content Exception Handling retry raise ensure else  catch and throw Exception classes Exception Handling Enclose the code that could raise an exception with a begin/end block and use rescue clauses to tell Ruby the types of exceptions that you want to handle. The syntax for exception handling : 
 begin  
      #- statements
 rescue OneTypeOfException       #-
 handle the exception rescue AnotherTypeOfException       #- 
handle the exception else       
# Other exceptions
 ensure 
      # ensure block is always executed
 end 
 Everything from begin to rescue is protected 

in the block. 
If an exception occurs during the execution of this block of code, control is passed to the 

block between rescue and end.
 
For each rescue clause in the begin block, Ruby compares the raised Exception against each 

of the parameters of the...