13 November 2006

Alien Abduction

aka Function Bucket with Cheese

When a class has all of its innards exposed as public methods, but requires those methods be called in a specific order such that correct behavior is exhibited, we call it Alien Abduction, from the idea that some external intelligence seeks to understand an entity's function by probing and exciting muscles.

  • all or most methods on a class are made public in order to test the class (if you're lucky)
  • multiple constructors are available, depending on the intended use of the class
  • there is an implicit required order to method invocations, though the order is not expressed clearly
  • public methods are available that make no use of the state of the object

No comments:

Post a Comment