• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

What exactly constitutes a framework?

chrstrbrts

Senior member
Hello guys,

I was wondering if anyone has a strict definition for 'framework'.

I read someone's definition somewhere online; he simply said that a software framework is just any pre-written code that can be called out to and utilized by programmers writing code in the future.

By that definition, a simple DLL would be considered a framework.

But, so would the Java Virtual Machine.

There's a hell of a lot of a difference between a simple DLL and the entire JVM.

So, I was wondering what the exact definition for 'software framework' is.

Thanks.
 
I would disagree with your definition. What you defined is an API.

A framework is a system that either performs some function minimally, or can with minimal changes, which allows expanding its functionality in specific places, but which limits its adaptability outside those places.

I generally prefer an API to a framework. Although my current work is in Drupal, and that framework is generally flexible enough to do whatever I need to do.
 
I doubt there is an exact definition. But here is my best way of pointing out the difference.

A framework is all about dictating the "right" way to do something. Frameworks are intended to rarely be escaped, they provide everything. Generally, a framework will not play nicely with things outside of the framework.

So, for example, Ruby on Rails is very much a framework, you are expected to play entirely in the rails world and escape should be rare/non-existent.

You can generally tell if something is a framework when companies look for an X developer instead of a Language developer. For example "Looking for a wordpress developer" or "Looking for a Grails developer". You won't often see a posting looking for a "Jquery developer" or "Gson developer".

Frameworks surround the application, libraries are surrounded by the application.

In general, I think frameworks of all kinds are a mistake. They may provide a lot of functionality, but they have the big problem of being big. When a framework makes major changes, it can often cause you to need to completely rewrite your application. On the flip side, when a library makes major changes it will often only force you to rewrite a small section of the application (if that, often times library breaking changes don't affect your current usage).
 
Another way of looking at it is a framework simplifies development by trading flexibility for a pre-written workflow design with a set of constraints.

An API exposes a set of features but leaves how to combine them entirely up to you.

A framework has you plug in specializations of itself to match your workflow, but it can only bend so far before it either blocks your intentions or forces you to break out of it.

People often tout a framework with a 5-line text editor or something like that. Which seems nice until you realize the built-in document serialization doesn't support a feature you need, or the database query can't be optimized for your use.

I designed four decent-sized applications (hundreds of thousands of lines of code) using Microsoft's old MFC framework for my previous and current employers. MFC was pretty good as long as you accepted its supported ways of building a user interface. Sadly, each of the three apps needed enough customization that I had to ignore MFC's document serialization, ignore dialog data exchange, and mangle the puffin out of the default Single Document Interface UI design. So I used the "classes" part but only scattered bits of the framework.
 
I was wondering if anyone has a strict definition for 'framework'.

Nope, not really. I think you can pretty reasonably say that all frameworks are libraries, but not all libraries are frameworks. The larger the library, the more likely that it would be a framework, IMO. Where's the dividing line? I dunno, and I kind of doubt that you'll find any conclusive definition or agreement.
 
Back
Top