Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

What is a framework?

by Sprad (Hermit)
on May 23, 2005 at 17:08 UTC ( [id://459625]=perlquestion: print w/replies, xml ) Need Help??

Sprad has asked for the wisdom of the Perl Monks concerning the following question:

Not explicitly about Perl, but please indulge me:

I keep hearing about "frameworks". But when I try to find out what a framework is or does, I'm met with a maze of buzzwords like "internally consistent architecture" and "middle-tier", which aren't helping me any.

So what, really, is a framework? Can anyone offer a simple, jargon-free explanation? What can I do if I have one, that I couldn't do without one?

---
A fair fight is a sign of poor planning.

Replies are listed 'Best First'.
Re: What is a framework?
by dragonchild (Archbishop) on May 23, 2005 at 17:33 UTC
    It's an infrastructure, essentially. It provides most of the pieces and you provide the missing bits to make an application. For example, CGI::Application provides a framework in that you only have to provide what each runmode does and how it presents itself. C::A does the rest (handling CGI input/output, validating URLs, dispatching runmodes, etc). Other Perl frameworks would include Maypole, Tk, and wxPerl. Other frameworks in general would include Ruby-on-Rails, MSVC++, VBA, and .NET - most MS products, for that matter.

    • In general, if you think something isn't in Perl, try it out, because it usually is. :-)
    • "What is the sound of Perl? Is it not the sound of a wall that people have stopped banging their heads against?"
Re: What is a framework?
by jbware (Chaplain) on May 23, 2005 at 18:33 UTC
    Just for kicks I went to wikipedia. I honestly expected to find a jargon-filled and useless definition, but was pleasantly surprised. I think they have a decent definition.

    "In software development, a Framework is a defined support structure in which another software project can be organized and developed. Typically, a framework may include support programs, code libraries and a scripting language amongst other software to help develop and glue together the different components of your project. "
    Source: http://en.wikipedia.org/wiki/Framework


    - jbWare
      That shouldn't be surprising, because wikipedia is written by real people who aren't trying to sell you something.
Re: What is a framework?
by samtregar (Abbot) on May 23, 2005 at 18:01 UTC
    A framework is a kind of software which provides a certain amount of functionality and requires you, the programmer, to fill in the rest. Frameworks are distinguished from applications by this requirement.

    You can't find a single definative definition of "a framework" because it's a weak descriptor. It identifies only one facet of a system - that it requires you to write code to extract value - but leaves everything else up in the air.

    -sam

      A framework is a kind of software which provides a certain amount of functionality and requires you, the programmer, to fill in the rest. Frameworks are distinguished from applications by this requirement.

      That definition helps separate frameworks from applications but could also be the definition of any module -- all modules require the programmer to "fill in the rest". Perhaps we could say that a framework is software that provides not only a basis for application development (which all modules do) but also a specific logic/flow of the application. A non-framework module requires logic and specifics to become an application, a framework module requires only the specifics.

      That's not quite right either, but maybe closer.

Re: What is a framework?
by gaal (Parson) on May 23, 2005 at 18:59 UTC
    BrowserUk makes an interesting distinction between frameworks and modules here.
Re: What is a framework?
by johnnywang (Priest) on May 23, 2005 at 19:28 UTC
    The simplest way people define framework is: "don't call me, I'll call you." Therefore frameworks tend worry about life-cycle management (e.g., http request cycle), resource management (e.g., connection pools), and transaction management. Framework doesn't have to be big, CGI::Application is a very lean framework. Frameworks define a method of doing things, as a user, we need to fit into that method. I'd say the quality of a framework has two aspects: does it provide enough to make most things easier, and does it allow easy extensions.
Re: What is a framework?
by oopplz (Novice) on May 23, 2005 at 21:38 UTC

    .NET is the big producer of "framework" jargon. The idea behind a framework is to make the life of a developer easier. A framework provides the programmer with ready-made solutions to common problems. For example, what if you, as a programmer, had to develop a big application? You would need to consider security, distribution, versioning, object persistence, database interface, documentation, etc. A framework will provide an already-developed solution for each of these considerations. In effect, the programmer doesn't have to "think about it," it is already built-in to the programming environment. By addressing the considerations at code level the programmer gets a big jump on future work because the framework will "take care" of all the grunt work for you.

    The downside is that it increases the learning curve dramatically. Instead of learning the language, you now must also learn the framework. If you are dealing with a "framework" language, like .NET, you must adhere to the framework rules. Throw away all you ideas about how you *used* to do things! You must now follow the framework for things to work properly. If you ever shifted from VB .OLD to VB .NET you will know what I mean...

    There is a very good explanation of framework thinking in "Introducing .NET" by David S. Platt.

      .NET is the big producer of "framework" jargon.

      I would say that Java also deserves a big share of the credit in terms of producing framework jargon. ;-)

Re: What is a framework?
by dynamo (Chaplain) on May 23, 2005 at 22:02 UTC
    One other thing. On MacOS X (and it's predecessor NeXTStep) there is an explicit structure used in application development called a Framework. Search around on http://developer.apple.com for more info if you are hearing about these frameworks in a Macintoshian context..

    It's essentially a library of functions evolved a step or two - it can include executable code, headers, resources, documentation, translations of strings, and other such stuff.

    It's not directly perl-related, true, but you can use perl to develop Frameworks (see Camelbones), and there are perl-related Frameworks you use from time to time.

Re: What is a framework?
by tlm (Prior) on May 24, 2005 at 01:12 UTC

    So what, really, is a framework? Can anyone offer a simple, jargon-free explanation?

    That's like asking for dehydrated water. :-)

    the lowliest monk

Re: What is a framework?
by adamk (Chaplain) on May 25, 2005 at 12:13 UTC
    Another way of looking at this might be the following.

    A lot of programming is based on inside->out, like modules that is one small part of your larger and wider-ranging application. You encapsulate the program of encrypting a file for example. It usually does one task, and does it right.

    Frameworks mostly work from the outside in. That is, your application is primarily built INSIDE the framework, which attempts to provide as much $stuff to complete your task. The functionality contained in the framework is potentially far more wide-ranging than the bits and pieces that you make yourself.

    This can be a problem sometimes. Workflow is much more a framework than a module. It not only provides a workflow engine, it also provides you a (practically) mandatory persistance mechanism, a standard logging mechanism, history functionality and so on and so forth.

    If you want workflow functionality as just a bolt-on feature for a much larger application, it can be difficult to use a framework like Workflow because it wants to be running the show and be the centre of attention. But until Object::Workflow arrives, it's the only solution we've got.

    So it generally depends what task you are doing. If you are doing something that primarily matches with what a framework does, then using the framework will save you a ton of time.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://459625]
Approved by sulfericacid
Front-paged by Grygonos
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (6)
As of 2024-03-28 08:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found