Define “Framework”

Many people wonder what a framework is. Many people work with people who work with a framework, and yet these people just pretend to know what this is about.

The problem is, not only the concept of framework is not immediately understandable, but also that most of the explanations of the term “Framework” suck.

How they define it

Take the most famous framework, Ruby on Rails. They don’t bother to define what a framework is. People coming to Rails either already know what this is all about, or think that this is something important because Rails is famous.

The Django framework proposes this definition:

A high-level Web framework is software that eases the pain of building dynamic Web sites. It abstracts common problems of Web development and provides shortcuts for frequent programming tasks.

They complement this definition with a page-long list of the Django features. That’s the same approach as Rails: Understand what our framework does, you will understand what a framework is in general. Kind of biaised.

Wikipedia tries to be more specific and says:

A software framework is a reusable design for a software system (or subsystem). This is expressed as a set of abstract classes and the way their instances collaborate for a specific type of software.

That’s too many words. 9 out of 10 IT managers jumped to the .Net platform before reading the second sentence (and therefore misunderstood the true nature of a framework). Besides, it doesn’t explain what a framework does for you.

Let’s see how symfony defines frameworks:

A framework streamlines application development by automating many of the patterns employed for a given purpose. A framework also adds structure to the code, prompting the developer to write better, more readable, and more maintainable code. Ultimately, a framework makes programming easier, since it packages complex operations into simple statements.

Although this sentence was written by me, it is not much better than the former ones.

Framework newbies are still wondering whether a framework is good, if they can use it to go shopping, if it enhances the sexual activity, and if it is something convenient to talk about during lunch.

Enter geeks

One of the reasons why the concept of framework is not that easy to make clear is that it’s a geek matter. Frameworks are used by programmers who develop enough applications to become unsatisfied with a language alone.

These people are interested in stuff like design patterns, test-driven development, object-relational mapping, and other dirty words. They just don't speak the same language as you do. And try to get an astrophysicist talk clearly about Strings Theory. Very few people know enough about a subject to be able to explain it, and unfortunately these people often don’t know enough people who don’t know anything about this subject, so they are not used to making it accessible.

Let’s try

Now let’s try it ourselves. The idea is to define the term “Framework” in a single sentence, and to check that anybody with minimum knowledge of web applications can understand it.

“If god had a framework, he would build the world in 3 days.”

All right, marketing boy, this may make your girlfriend laugh, but it’s not going to help us a lot.

“Frameworks are a supplementary layer on top of a programming language that make development faster and more productive”.

So this is something interesting for programmers, but what if I am a manager with three alternatives for a new website, built with either the ezPublish CMS, or the symfony framework, or the BEA Weblogic application server?

if($framework)
{
  Just::do($it);
}
else
{
  $it = strstr(fibonacci(75 * _SERVER['foo'])), strbin2hex('1101'));
  sort($it);
  if($it instanceof Crap)
  {
    thrown new CrapException('bummer!');
  }
  else
  {
    try_again();
  }
}


Hey spaghetti code man, I guess you learnt PHP development by hacking Wordpress and Gallery, didn’t you? Thanks, but you're not helping.

I can’t do this. Can you?

I guess I failed. Defining the word “Framework” in a single and simple sentence is just too hard for me tonight.

My only hope is that, as often in the web 2.0, the true value of this post will come from its comments, rather than from its body. Please help me: How would you define “Framework”?

6 Comments so far

  1. Bernhard Schussek on August 29th, 2007

    This is indeed a complicated question, in whose answer I failed a couple of times.

    When I discovered the symfony framework, I've been in just the same situation. I read about it and it sounded kind of nice, but being new to frameworks I just kept on asking myself what it's all about ...

    Now, having a little more experience with frameworks, I would try to define the term along these lines:

    "A collection of extendable and tested programming code, that handles repetitive procedures and helps you focusing on the real task of an application."

  2. MartinK on August 30th, 2007

    For me one of the most important aspects of a framework is the Hollywood Principle. Let's quote Wikipedia:
    Software frameworks rely on the Hollywood Principle: "Don’t call us, we’ll call you." This means that the user-defined classes (for example, new subclasses), receive messages from the predefined framework classes. These are usually handled by implementing superclass abstract methods.

  3. Michael Piecko on August 30th, 2007

    I compare it for non programmers always with the way to build a house. You build it with reusable elements like bricks, windows, doors, stairs ... things you don't have to build yourself.

    And to build it safe and stable, you use design patterns, like a construction plan or other common practices. That helps me a lot to explain a framework.

    Especially in terms of RAD, because you still have to work. A framework is not a ready application, but it helps you to do it faster and future-oriented.

  4. gerald on August 31st, 2007

    I am not going to find a better definition but rather just a comment for fun. I think that your 'marketing' definition is pretty good, although, making the world in 7 days was already a fantastic proof of efficiency of His own framework. Yes God must have used a framework at that time!
    Let the scientific community work on finding what was this framework, it could be useful again...!

  5. Klemen Slavič on August 31st, 2007

    I'd agree with Michael on this one - real-world analogies often work best, as demonstrated in his post.

    In one sentence, given that context, I'd say the best and simplest way to word it is to say:

    "A framework is a pile of bricks, you just apply the mortar."

    It allows you to make the assumptions that the bricks themselves are solid enough for the mortar to hold together and construct something useful out of them - that kinda applies on the principle of having modularized, tested code on which you rely instead of making the underlying modules themselves.

  6. COil on September 1st, 2007

    I don't agree, Pear is a set of bricks but it does not make it a framework.

Leave a reply