Chapter 15

Bulletin Board

image

15.1 Constraints

  • Larger problem is decomposed into entities using some form of abstraction (objects, modules or similar).
  • The entities are never called on directly for actions.
  • Existence of an infrastructure for publishing and subscribing to events, aka the bulletin board.
  • Entities post event subscriptions (aka "wanted") to the bulletin board and publish events (aka "offered") to the bulletin board. The bulletin board infrastructure does all the event management and distribution.

15.2 A Program in this Style

  1 #!/usr/bin/env python
  2 import sys, re, operator, string
  3
  4 #
  5 # The event management substrate
  6 #
  

Get Exercises in Programming Style now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.