views:

22

answers:

3

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?

+3  A: 

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).

Nathan Hughes
Ie: Inversion of control.
NullUserException
A: 

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.

notJim
A: 

Frameworks tend to be more generic than libraries. You might write a library of utilities for your application. You application might use a (generic) framework that could be used for a completely different purpose.

hvgotcodes