1/04/2009

Twisted Documentation: The Pasta Theory of Design

1405309321_63eddae70d_b Over the holidays I’ve been learning the Twisted framework and reading through the Twisted Core Documentation.  I came across this gem of an analogy…

The pasta theory of design:

  • Spaghetti: each piece of code interacts with every other piece of code [can be implemented with GOTO, functions, objects]
  • Lasagna: code has carefully designed layers. Each layer is, in theory independent. However low-level layers usually cannot be used easily, and high-level layers depend on low-level layers.
  • Ravioli: each part of the code is useful by itself. There is a thin layer of interfaces between various parts [the sauce]. Each part can be usefully be used elsewhere.
  • ...but sometimes, the user just wants to order "Ravioli", so one coarse-grain easily definable layer of abstraction on top of it all can be useful.

Twisted Documentation: The Evolution of Finger: making a finger library

I love it!

No comments: