The PEAK Developers' Center   GettingStartedWithPeak UserPreferences
 
HelpContents Search Diffs Info Edit Subscribe XML Print View
The following 312 words could not be found in the dictionary of 50 words (including 50 LocalSpellingWords) and are highlighted below:
And   Another   Attribute   Can   Component   For   Further   Good   In   Interface   It   Note   November   Python   Since   So   The   These   Thus   You   able   accessed   actually   adapt   adaptation   addressing   advise   all   alternative   am   an   and   another   any   application   applications   are   area   argv   as   at   attribute   based   basic   basics   be   because   best   binding   bindings   build   built   by   can   changes   changing   class   classes   code   collaboration   collaborator   collection   column   com   command   commands   component   componentize   components   composable   concepts   config   configurable   configuration   conform   connect   connection   connections   connects   constructor   context   controlled   converting   core   create   customize   datatypes   daunting   declarations   dependencies   dependency   different   direction   do   docstrings   don   drivers   each   easier   easy   eby   eliminates   enables   encounter   encouraging   entirety   etc   every   everything   example   executable   existing   experienced   expose   exposed   exposes   extend   extreme   extremely   facilities   fairly   familiar   files   find   focused   following   for   format   framework   frameworks   from   functions   globals   grasp   grokking   have   having   hidden   hierarchy   how   however   idea   if   implementations   important   impossible   in   instance   interfaces   introduces   involved   is   isn   isolate   it   its   just   key   keywords   kinds   known   level   library   line   list   listed   little   ll   loggers   look   made   make   makes   making   management   many   massive   me   meet   method   methods   might   mini   modularity   module   modules   most   name   naming   nearly   necessary   need   no   non   not   object   obtain   obtains   of   offer   on   one   option   or   order   other   overridden   overriding   package   packages   part   peak   persistent   pipermail   point   points   programmer   programming   properties   protocols   provided   purposes   python   ranging   rather   read   realize   really   refer   reference   references   requirements   reusability   ridiculously   running   same   sarna   schemes   secret   seems   setattr   settings   shared   simple   since   single   singletons   slightest   so   sockets   some   somebody   sometimes   source   start   stdin   stdout   storage   style   subclassing   system   taken   task   than   that   the   their   them   then   there   these   they   thing   things   this   thoroughly   to   tools   top   tutorial   two   typemaps   types   typical   understand   understanding   uniform   unique   up   usable   use   useful   uses   using   variable   variables   variety   various   via   want   way   ways   were   when   which   will   with   without   words   working   wrap   you  

Clear message


The following is taken from http://www.eby-sarna.com/pipermail/peak/2003-November/000929.html. Note that the slightest of changes were made to conform to a Q/A format.

Q: I am a fairly experienced python programmer, however the PEAK package seems fairly daunting to understand.

A: PEAK is a little easier to grasp if you realize that it's actually two things:

  1. A "framework for frameworks", known as the PEAK core framework

  2. A collection of task-area frameworks built on the core

So, to use PEAK, you need to be able to understand the core concepts, and then you can make use any of the non-core frameworks.

For example, 'peak.running.commands' is a mini-framework focused on "command line" applications that have a stdin, stdout, argv, and so on. It's based on components and adaptation, which are facilities provided by the core framework.

Another example is 'peak.storage.SQL', a mini-framework for working with DBAPI drivers in a uniform way, with persistent connection management, and typemaps for converting column types to application datatypes.

The "secret" of the core framework is that it enables extreme modularity and reusability, by encouraging a programming style that exposes collaboration dependencies and eliminates singletons.

In a typical Python class library, classes reference other classes and modules as part of code. A method of a class might create an instance of another class, or refer to a module-level variable. (The same thing, really.) These references are impossible to customize without changing source code, or massive subclassing and overriding of the methods involved. Further, if an option is controlled by a module-level variable, the module can't be shared by components that need *different* settings for that variable.

In other words, the typical Python class library is *not* a "component". It is not configurable and composable with other components because it is a single instance, and its connection points are hidden, rather than exposed.

peak.binding, however, makes it ridiculously easy to isolate and expose any dependency as an object attribute, that can then be overridden in a variety of ways ranging from simple setattr() to constructor keywords to configuration declarations. And, it introduces the idea of components having *context* from which they can obtain configuration variables, rather than using globals. Thus, each instance of a component class obtains its configuration and connects to collaborator components via its unique context.

Since the typical Python library is not usable as a component, PEAK's non-core frameworks do their best to wrap existing Python facilities up as useful components, or offer alternative implementations when there's no way to componentize existing frameworks or tools, or existing tools don't meet PEAK requirements.

Q: I have read and understand the concepts in the tutorial. Can somebody point me in some direction to start grokking PEAK in it's entirety?

A: Good, because the concepts in the tutorial are the most important basics. Component hierarchy and bindings are key to nearly every other package in PEAK.

The key packages to understand are (in this order):

It isn't necessary to understand how to extend the frameworks provided by these packages, just have a basic understanding of the concepts and API provided by each one. The two best things to look at are the 'interfaces.py' in each 'peak.*' package, and the docstrings for API classes and functions. (API classes and functions are listed by name in the '__all__' list at the top of each module in a package.)


PythonPowered
EditText of this page (last modified 2004-09-22 13:01:52)
FindPage by browsing, title search , text search or an index
Or try one of these actions: AttachFile, DeletePage, LikePages, LocalSiteMap, SpellCheck