Back to EuroPLoP Writers Workshop page.
By placing defaults and constants into a class interface, certain method signatures become longer with the use of more parameters. With convenient methods however, you will have a more flexible class interface as well as a more readable client code.
The Bureaucracy pattern is a recurring design theme used to implement hierarchical object structures which are capable of maintaining their inner consistency themselves. It is a composite pattern which is based on the Composite, Observer and Chain of Responsibility pattern. Composite patterns require new presentation and modeling techniques since their complexity makes them more difficult to approach than non-composite patterns. This paper uses role modeling to present the Bureaucracy pattern and to explore its design and implementation space. Role modeling has proved to be very useful to get a grip on this complex pattern, and it can be expected to work well for design patterns in general.
In many situations, especially in interactive systems, it is desirable to connect objects by specifying dependencies between the objects. The set of mutually connected objects exhibits certain behaviour as a whole. This paper describes a design pattern, Connected Group, that treats groups of objects as if the groups are real objects. By doing so, many common object-oriented programming techniques including design patterns can be directly applied on groups of connected objects.
Sometimes the built-in type system of a language is too inflexible or does not provide the features you need. You can build your own type system bycreating objects that represent types, letting each application object know its type, and checking these types at run-time. Reified types can be an entrance into a world of reflective programming.
We propose to use objects as closures for behavior parameterization. In contrast to reuse by inheritance, they realize reuse by composition. Closures allow black-box behavior parameterization with encapsulated components, promote function reuse, allow calculations on demand, represent first-class behavior, i.e., feature protocol-, undo-, and persistence mechanisms, and can represent ``business-transactions''. In this paper, we present closures as the object-oriented design pattern Recipe. In contrast to the Command pattern, Recipe establishes a useful collaboration with iterators. We show in particular how to use generic recipes with iterators in order to allow multi-dispatching operations on heterogeneous data structures.
This pattern applies if you use a Relational Database Management System (especially ORACLE) and it is necessary to retrieve data from more than one row (with a minimum of locking). For data retrieval in SQL usually an interactive SELECT statement is applied. The SELECT retrieves attributes from one or more rows of one or more tables from a database. For host languages like C or C++ it s easy if the retrieved data is just one row. In this case the program has one host variable for each attribute, which contains the result. If the result is a set of rows then host arrays or DB cursors have to be used.The problem is that host arrays are bound to the array dimension. More rows than this dimension could not be retrieved. Thus - for general - DB cursors are preferable. These DB cursors are analogue to cursors for collections in C++ (similar but slightly different semantics). The pattern is for beginners in embedded SQL with RDBMS, who know SQL, but had no experience how to implement SQL in programming languages.
The paper describes a typed-language specific pattern, which implements a mechanism for creating objects given any kind of description. Two application examples are presented showing how to implement and use the pattern in practice. In general the pattern can be applied by adding two static members to the classes which take ` part in the Abstract Constructor mechanism. The pattern can be used in the following cases: