Language concepts and design patterns

Abstract

Programming languages aim at the construction of simple but expressive programs. To achieve this, plenty of language concepts have arisen over time. Design patterns aim at the solution of common design problems. To achieve this, plenty of approved design concepts have been collected. We claim that language concepts and design patterns are essentially the same. Indeed, a language may offer a design pattern as a language concept; we call such patterns "language patterns". A design pattern can be implemented in terms of other design or language patterns. Since a concrete programming language only supports a subset of language patterns, every other pattern must be expressed in terms of this subset. We call such an implementation a "workaround". The specification of a workaround imposes proof obligations: it must be shown that a workaround simulates the pattern. Once proved correct, we can collect patterns and their workarounds in a trustworthy catalogue. This helps software developers to correctly apply patterns in any language and helps the language designer to decide which patterns to put into the language core. We demonstrate this pattern integration process with well-known design patterns and concepts of object-oriented languages. Additionally, we list important language patterns together with their workarounds

    Similar works