Idioms and patterns

Object orientation has brought about a radical shift in our notion of software development. The basic mechanisms of object-oriented programming, encapsulation and inheritance, have clear advantages when it comes to data-hiding and incremental development.

Idioms and patterns


Additional keywords and phrases: generic types, assertions, canonical classes, event-driven computation

slide: Idioms and patterns

However, these basic mechanisms alone do not suffice for the realization of more complex systems. In this chapter, we will look at idioms and patterns for object and class composition. Patterns, as originally introduced in  [GOF94], characterize a generic solution to a problem or dilemma in design. Idioms may be understood as the implementation techniques underlying the realization of (design) patterns.

First we will look at some examples in Java, illustrating the use of inheritance and delegation for the realization of some simple idioms and patterns. Then, we will briefly deal with polymorphism in C++, including the use of assertions that may be used to enforce contractual obligations. After discussing some of the idioms and patterns that have been employed in the hush framework, we will look more closely at the catalogue of design patterns introduced in  [GOF94]. Finally, we will study the reactor pattern as introduced in  [Schmidt95] and briefly explore event-based software architectures.