Change the future

Saturday 12:10 p.m.–12:55 p.m.

Dispatch Magic

Ben Bangert

Audience level:
Intermediate
Category:
Web Frameworks

Description

One of the most common tasks in modern web frameworks is to ease the task of writing bits of code that are then called by the framework. Handling this task is the first major undertaking of any web framework, and the part that most web frameworks have in common.

How do frameworks locate this code? What basic patterns apply to all frameworks? How does this make me be a better web programmer?

Abstract

One of the most common tasks in modern web frameworks is to ease the task of writing bits of code that are then called by the framework when a certain URL is hit.

How do frameworks do this? What are the most common approaches to interpreting the URL?

This short talk will focus on several common URL resolution methods:

  • Regular expressions
  • Object-dispatch
  • Traversal (Similar to Zope Acquisition)

Understanding how the framework interprets the URL's to find code to call helps us gain a deeper insight into web frameworks in general. This meta-knowledge of how web frameworks operate allows us to easily move between frameworks in Python, and even other languages.