ifacethoughts

Libraries, Toolkits And Frameworks

This post has already been published on code::gallery blog which now has been merged into this blog.

We come across a mesh of nomenclature regarding libraries everyday - Application Programming Interface (API), libraries, toolkits, frameworks, and probably some more. So, what is the difference?

Some of these terms do overlap. API is the interface provided by the library, toolkit or the framework. This interface, usually, works like a contract between the creator and the user. Library is a generic term for a group of functionality provided. These libraries together can form a toolkit or a framework. Gang of Four (GoF) explain the difference between toolkits and frameworks in Design Patterns - Elements of Reusable Object-Oriented Software:

A toolkit is a set of related and reusable classes designed to provide useful, general purpose functionality. Toolkits don’t impose a particular design on your application; they just provide the functionality that can help your application do its job. They let you as an implementer avoid recoding common functionality. Toolkits emphasize code reuse. They are the object-oriented equivalent of subroutine libraries.

…

A framework is a set of cooperating classes that makeup a reusable designed for a specific class of software. The framework dictates the architecture of your application. It will define the overall structure, its partitioning into classes and objects, the key responsibilities, thereof, how the classes and objects, the key responsibilities thereof, how the classes and objects collaborate, and the thread of control. A framework predefines these design parameters so that you, the application designer/implementer, can concentrate on th specifics of your application. The framework captures the design decisions that are common to its application domain. Frameworks thus emphasized design reuse over code reuse, though a framework will usually include concrete subclasses you can put to work immediately.

You commit to a functionality when you use a toolkit, whereas you commit to the design when you use a framework. That is why it is of prime importance to choose the right option for the job. A wrong choice can ruin the entire effort.

This is also important for the creators. Since a framework provides design reuse, it is imperative that it is flexible. Otherwise, it might limit the programmer in more ways than enable him/her.

Technorati tags: , ,

Copyright Abhijit Nadgouda.

Discussion [Participate or Link]

  1. iface thoughts » Blog Archive » Providing Web API said:

    [...] The challenge in designing an API is to provide flexibility but also hide the irrelevant information. Alex Bosworth provides a nice list of rules for providing a Web API with some examples. What are a few simple rules for providing a web API? [...]

  2. Difference Between A Library And A Framework | iface thoughts said:

    [...] had thought about this earlier, but I feel that it needed more [...]

  3. Frameworks Don’t Suck, Decisions Might | iface thoughts said:

    [...] selection of frameworks, without realizing the implications. They can be constraining, especially frameworks because they impose the architecture and design. You create a dependency when you buy into the [...]

  4. Reusability And Non-semantic Names | iface thoughts said:

    [...] more to understand when to use them and when not. Or I might get too pedantic to call some of them libraries and not frameworks. But non-semantic names should not be a reason to not use [...]

  5. With a title like Is Ruby brainwashing us?….I had to read on. And then another in one day Java? It’s So Nineties Oh this is so going to start a war… I like PHP, I learnt C at university and use it most days in my job, it’s my language of choice, so said:

    [...] had thought about this earlier, but I feel that it needed more [...]

Say your thought!

Who are you?

If you want to use HTML you can use these tags: <a>, <em>, <strong>, <abbr>, <code>, <blockquote>. Closing the tags will be appreciated as this site uses valid XHTML.

freshthoughts

contactme

Abhijit Nadgouda
iface Consulting
India
+91 9819820312
Y!: anadgouda
GTalk: anadgouda@gmail.com
MSN: anadgouda@hotmail.com
Skype: anadgouda
My bookmarks

currentproject

Complete Wellbeing

badgesand...

This is the weblog of Abhijit Nadgouda where he writes down his thoughts on software development and related topics. You are invited to subscribe to the feed to stay updated or check out more subscription options. Or you can choose to browse by one of the topics.

Twitter - #mumbai - The city has started working today. The fears are still there, but the spirit will help in fighting it.