Metaphor and Metonymy in Object-Oriented Design Patterns


Authors: James Noble, Robert Biddle, Ewan Tempero
Source: GZipped PostScript (166kb); Adobe PDF (448kb)

The key principle of object-oriented design is that each program object should correspond to an object in the real world, that is to say, a program is a metaphor for the world. More advanced object-oriented designs, such as many of Gamma et. al.'s Design Patterns, are not directly metaphorical: State objects, Strategy objects and Visitor objects, for example, do not correspond to objects in the real world. We show how these patterns, and other similar designs, can be understood as metonymy, rather than metaphor, that is, they are based on an attribute, cause, or effect, rather than being based on something in the world, in terms of Jakobson and Lodge's typology. Understanding how both metaphor and metonymy can be used in design can illustrate how design patterns work alongside more traditional object-oriented modelling to produce designs that are accurate, flexible, and better

[Up to Computer Science Technical Report Archive: Home Page]