Where does the idea that an object should only do one thing come from?

SOLID Principles from Bob Martin.

Single Responsibility Principle to be exact.

Although, in the first page of the chapter on the Single Responsibility Principle, he states:

This principle was described in the work of Tom DeMarco and Meilir Page-Jones. They called it cohesion.

The references for the work he mentioned are:

  • Structured Analysis and System Specification, Tom DeMarco, Yourdon Press Computing Series, 1979
  • The Practical Guide to Structured Systems Design, 2d. ed., Meilir Page- Jones, Yourdon Press Computing Series, 1988

Other sources (from S.Lott in comments) include:

  • Wikipedia article on GRASP
  • c2 article on Allocation of Responsibility

The man who invented the idea of modularity in software was Dr David Parnas. The classic paper is On the Criteria To Be Used in Decomposing Systems into Modules

While he doesn't talk about OO in general (as it wasn't around yet), the ideas of OO extend naturally from Dr Parnas' work. And part of this work is analysis on how to decompose your software into modules, and that modules should be single purpose.

Tags:

Oop