Library vs Framework (was Dr. Dobb's Python-URL!)

Kay Schluehr kay.schluehr at gmx.net
Wed Aug 17 03:19:39 EDT 2005


Simon Brunning wrote:
> On 8/15/05, Rocco Moretti <roccomoretti at hotpop.com> wrote:
> > Which lead me to the question - what's the difference between a library
> > and a framework?
>
> If you call its code, it's a library. If it calls yours, it's a framework.

Pretty!

I don't think it is an oversimplification. The crucial difference is
that between interface and implementation. A framework forces the
programmers code to conform certain interfaces and contracts. It does
not restrict implementation in any way ( which might be empty ). The
implementation part uses library functions that do not tell much about
the implementation and nothing about interfaces. Libaries give you any
freedom but sometimes ( and only sometimes ) people also like to
structure their code ;)

What are frameworks really good for - a very true success story.

A colleague of mine used to spread all kinds of flags ( state- and
property markers ) over the code that were used to glue everything
together until I raised my tyranny of frameworks. It was a hard
struggle for an OO warrier and took me almost a year or so to become
the undebated projects architect/dictator who trashed all kind of
misguided "freedom" ( i.e. bad code ): "What the fuck is this?" "I
worked almost a week on it!" "It has to be reworked." "No, you don't do
it!" I did it. Who claims that social life is easy? What is nice about
this kind of cruelness is not only my colleague became finally happy
and hopefully learned at least a little bit about programming but also
our customers were gratefull about stable code, thight release
schedules and just-in-time requirement dispatch. Now we have some
bread-and-butter maintenance contract and true freedom to experiment
with other more interesting things besides this. But the struggle just
starts again with the new project ;)

Kay




More information about the Python-list mailing list