O'Reilly Open Source Convention.
Books Safari Bookshelf Conferences O'Reilly Network

Arrow Home
Arrow Registration
Arrow Speakers
Arrow Keynotes
Arrow Tutorials
Arrow Sessions
Arrow At-a-Glance
Arrow BOFs
Arrow Events
Arrow Community
Arrow Exhibitors
Arrow Sponsors
Arrow Hotel/Travel
Arrow Venue Map
Arrow See & Do
Arrow Press
Arrow Mail List

O'Reilly Open Source Convention


The Template Method Design Pattern in Python
Alex Martelli, Google, Inc.

Track: Python
Date: Wednesday, July 09
Time: 4:30pm - 5:15pm
Location: Salon A

Of all Design Patterns presented in the classic "Gang of Four" book, "Template Method" is among the most useful. Python supports it, of course, but it also affords two even more powerful variants: [1] the base-class method may rely on data which a subclass can "override"; [2] the base-class method may use introspection in order to find out exactly which other methods the subclass has chosen to implement.

Martelli's talk illustrates the pattern itself, its variants, their usage (with examples from the standard Python library), and advanced implementation techniques, including the possibility of using metaclasses for the pattern's implementation, and of using the pattern itself in metaclasses as well as base classes.

O'Reilly Home | Privacy Policy

© 2003, O'Reilly Media, Inc.