Categories
terminology

Framework vs. Toolkit vs. Library [duplicate]

330

What is the difference between a Framework, a Toolkit and a Library?

0

    130

    Martin Fowler discusses the difference between a library and a framework in his article on Inversion of Control:

    Inversion of Control is a key part of
    what makes a framework different to a
    library. 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
    .

    To summarize: your code calls a library but a framework calls your code.

    0

      73

      Diagram

      If you are a more visual learner, here is a diagram that makes it clearer:

      (Credits: http://tom.lokhorst.eu/2010/09/why-libraries-are-better-than-frameworks)

      2

      • One of the assumed benefit of a framework is that it can be ported to a different platform with less issues. But in practice porting an application from one platform to another seems like such an unlikely situation that I wouldn’t want to incur the headaches it brings.

        Oct 14, 2015 at 22:01

      • For a bird’s-eye approach you’ve nailed it.

        – Jacksonkr

        May 11, 2016 at 18:40