The Artima Developer Community
Sponsored Link

Python Buzz Forum
Frameworks, Libraries, Conceptual Scalability

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Ian Bicking

Posts: 900
Nickname: ianb
Registered: Apr, 2003

Ian Bicking is a freelance programmer
Frameworks, Libraries, Conceptual Scalability Posted: Mar 13, 2004 4:06 PM
Reply to this message Reply

This post originated from an RSS feed registered with Python Buzz by Ian Bicking.
Original Post: Frameworks, Libraries, Conceptual Scalability
Feed Title: Ian Bicking
Feed URL: http://www.ianbicking.org/feeds/atom.xml
Feed Description: Thoughts on Python and Programming.
Latest Python Buzz Posts
Latest Python Buzz Posts by Ian Bicking
Latest Posts From Ian Bicking

Advertisement

Andrew Kuchling has a recent entry about Framelets (from this paper).

Framelets are small frameworks that can be used together. A framelet is (to quote):

  • is small in size ( < 10 classes);

  • does not assume main control of an application; and

  • has a clearly defined simple interface.

I don't like the term, but the concept is important. In the past I've talked about the distinction between a framework and a library, and this is the kind of thing I'm talking about, though I consider a library to be simpler than a mini-framework (I can't make myself use the term framelet, I just can't).

The Python standard library is mostly made up of "libraries" as opposed to frameworks (though not entirely). I think of a library as:

  • Imperative; it does things.

  • Public interface made up of functions and maybe a small number of classes (maybe one or two). Internally it may use more.

  • Users do not subclass anything.

Examples are things like pickle, shelve, urllib, csv, etc. Even logging is more a library than a framework, despite its complexity.

It also has some more mini-framework modules, like HTMLParser, threading, urllib2, and asyncore.

Generally when I work with these mini-frameworks I have to look up the documentation each time. I still can't remember quite how to spawn threads, even though I've written code to do so many times -- the actual subset of the interface I use is simple enough, but I'm always distracted. And urllib2 has annoyed me many times in the past, because things that should be simple are not -- the excuse is that you can do anything with urllib2 by subclassing various pieces, but I think it's wrong that you should subclass anything that could be easily expected (like HTTP authentication). [John Lee has been making good progress on some improved interfaces for client web usage, though.]

Still, the mini-frameworks in the standard library are generally easier to deal with than larger frameworks -- they are relatively generic and can usually be distilled into a application-specific library-like interface. For instance, if I use HTMLParser I immediately make a function-based interface to do the specific parsing or transformation I need for my application.

It's still a challenge -- how do you make something that is easy to start with, but complete and generic enough to grow with your application? The old make easy problems easy, and hard problems possible.

I've decided to make this the more general topic of my talk on FormEncode at PyCon, describing some of the design decisions I've made in FormEncode to try to make that particular framework both easy to use and complete.

Read: Frameworks, Libraries, Conceptual Scalability

Topic: log4j for dummies Previous Topic   Next Topic Topic: Nu even een geintje...

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use