Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 643 Vote(s) - 3.47 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What is the difference between a framework and a library?

#1
What is the difference between a ***framework*** and a ***library***?

I always thought of a library as a set of objects and functions that focuses on solving a particular problem or a specific area of application development (i.e. database access); and a framework on the other hand as a collection of libraries centered on a particular methodology (i.e. MVC) and which covers all areas of application development.
Reply

#2
A **library** performs specific, well-defined operations.

A **framework** is a skeleton where the application defines the "meat" of the operation by filling out the skeleton. The skeleton still has code to link up the parts but the most important work is done by the application.

**Examples of libraries:** Network protocols, compression, image manipulation, string utilities, regular expression evaluation, math. Operations are self-contained.

**Examples of frameworks:** Web application system, Plug-in manager, GUI system. The framework defines the concept but the application defines the fundamental functionality that end-users care about.
Reply

#3
Your interpretation sounds pretty good to me... A **library** could be anything that's compiled and self-contained for re-use in other code, there's literally no restriction on its content.

A **framework** on the other hand is expected to have a range of facilities for use in some specific arena of application development, just like your example, MVC.
Reply

#4
A library implements functionality for a narrowly-scoped purpose whereas a framework tends to be a collection of libraries providing support for a wider range of features. For example, the library System.Drawing.dll handles drawing functionality, but is only one part of the overall .NET framework.
Reply

#5
I think you pinned down quite well the difference: the framework provides a frame in which we do our work... Somehow, it is more "constraining" than a simple library.
The framework is also supposed to add consistency to a set of libraries.
Reply

#6
Library - Any set of classes or components that can be used as the client deems fit to accomplish a certain task.
Framework - mandates certain guidelines for you to "plug-in" into something bigger than you. You merely provide the pieces specific to your application/requirements in a published-required manner, so that 'the framwework can make your life easy'
Reply

#7
As I've always described it:

A Library is a tool.

A Framework is a way of life.


A library you can use whatever tiny part helps you. A Framework you must commit your entire project to.
Reply

#8
This is how I think of it (and have seen rationalized by others):

A library is something contained within your code. And a framework is a container for your application.
Reply

#9
I think that the main difference is that frameworks follow the "[Hollywood principle][1]", i.e. "don't call us, we'll call you."

According to [Martin Fowler][2]:

> A **library** is essentially a set of
> functions that you can call, these
> days usually organized into classes.
> Each call does some work and returns
> control to the client.
>
> A **framework** embodies some abstract
> design, with more behavior built in.
> In order to use it you need to insert
> your behavior into various places in
> the framework either by subclassing or
> by plugging in your own classes. The
> framework's code then calls your code
> at these points.


[1]:

[To see links please register here]

[2]:

[To see links please register here]

Reply

#10
I like Cohens answer, but a more technical definition is: Your code calls a library. **A framework calls your code**. For example a GUI framework calls your code through event-handlers. A web framework calls your code through some request-response model.

This is also called *inversion of control* - suddenly the framework decides when and how to execute you code rather than the other way around as with libraries. This means that a framework also have a much larger impact on how you have to structure your code.
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through