Tracing correct usage of design patterns

Neelam Soundarajan, Johan Dovland, Jason O. Hallstrom · 2007

We previously described a contract formalism for specifying design patterns precisely, and showed how the formalism amplifies the benefits of pattern usage. In this paper, we present an extension to the formalism that addresses problems which arise in systems involving complex interconnections among objects, including potential cyclic reference structures. In the presence of such structures, the behavior of an apparently simple operation can be quite complex. In this paper, we develop an approach that accounts for these complexities by formalizing pattern behaviors in terms of pattern-instance traces, ghost variables that record method invocations and completions on the objects participating in a pattern instance. We illustrate the approach by considering the standard Observer pattern. 1

Read the paper · More papers on PaperTik