Iris Classon
Iris Classon - In Love with Code

Stupid Question 195-196: What is the difference between a framework, toolkit and library?

[To celebrate my first year of programming I will ask a ‘stupid’ questions daily on my blog for a year, to make sure I learn at least 365 new things during my second year as a developer] I’m sitting on the train home from Norwegian developer conference and I am so tired, but happy. It was a great event and I got to meet many friends, some old some new. One person I met that I always enjoy talking to was (among others of course) Laurent Bugnion – the developer behind MVVM Light. I mentioned that I had talked about his framework in my session and he kindly corrected me and told me it was per definition a toolkit and not a framework. That is correct, MVVM Light is a toolkit and not a framework. We talked about the words framework, library and toolkit. Let’s define the three and how they differ.

framework

A framework is a structure, a skeleton. The structure provides the developer something to build by, but the bits and pieces needed is up to the developer to provide. Frameworks often solve a set of problems, and takes care of some boilerplate code the developer would otherwise have to write. A framework is a subsystem that contains the components you need for a set of problems.

A library is a library. A collection of objects that you can use, but in contrast to a framework you don’t have to use all of it- just take the bits and pieces you need.

Martin Fowler

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.

A toolkit is a set of tools for a developer, a good example is MVVM Light, which has a framework (an MVVM framework), bits and pieces that you may or may not use, templates and so on.

Comments

Leave a comment (via email)
Martin Fredriksson
6/14/2013 11:56:54 AM
Why are these distinctions important, if so? ;-) 
Laurent Bugnion
6/14/2013 1:50:56 PM
Reply to: Martin Fredriksson
Well they are important first because I am Swiss and we love details ;) but more seriously, they help to precise things. When I present MVVM Light to a new audience, it helps to use the correct words to describe what it does. I guess it's just what craftsmen do ;) 


Last modified on 2013-06-14