Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to distinguish a framework from a library of functions?

Is there a definition of "framework" that could be used to distinguish a framework from a collection of utilities functions and/or libraries?

Where does one end and the other start or is the line between them blurry?

like image 245
Confluence Avatar asked Sep 30 '10 18:09

Confluence


2 Answers

A library is something your program uses, your program calls the library code. A framework is something that you write code for, and the framework calls your code. For instance in an MVC web application you write controllers for it, those controllers are instantiated and called by the framework, the framework is in charge.

Spring is an example of a framework that also includes libraries (like spring-jdbc, for instance).

like image 108
Nathan Hughes Avatar answered Sep 24 '22 18:09

Nathan Hughes


The line is very blurry, IMO, and the word framework often comes down to a marketing term. For example, the .Net framework provides both a set of libraries (e.g., code that you can call, in Nathan Hughes answer), and a something you write code for that calls your code.

When I personally think of framework, I think of something that provides some hints as to the structure of your code. It tells you what components of your application might exist, and how they might interact, or where they might sit on the filesystem, even.

like image 36
davidtbernal Avatar answered Sep 23 '22 18:09

davidtbernal