Making Patterns Explicit with Metaprogramming

نویسنده

  • Daniel von Dincklage
چکیده

Design patterns have been a useful tool for a better understanding of the collaboration between several classes and objects in a program. One drawback of this approach is the lack of an explicit representation of the patterns used in a program, as the collaboration between classes is normally expressed in the code of the class itself. In this paper, we present a method for explicitly representing patterns in a program with the help of metaprogramming techniques. The method presented has benefits compared to traditional approaches with respect to documentation and reusability of the program, as well as providing a better separation of the protocol contained in the pattern.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

A Formal Language for Design Patterns

This article sets forth a rigorous approach to the concept of a ‘design pattern language’. We present a method of using a programming language to manipulate constructs of ordinary OOP language (such as classes and relations). We show that the specification of many design patterns can phrased as algorithms in this metaprogramming environment. The advantage is in delivering a precise method of de...

متن کامل

Explicit Namespaces1

A namespace is a mapping from labels to values. Most programming languages support different forms of namespaces, such as records, dictionaries, objects, environments, packages and even keyword-based parameters. Typically only a few of these notions are first-class, leading to arbitrary restrictions and limited abstraction power in the host language. Piccola is a small language that unifies var...

متن کامل

Explicit Namespaces

A namespace is a mapping from labels to values. Most programming languages support different forms of namespaces, such as records, dictionaries, objects, environments, packages and even keyword-based parameters. Typically only a few of these notions are first-class, leading to arbitrary restrictions and limited abstraction power in the host language. Piccola is a small language that unifies var...

متن کامل

Retrograde Analysis of Patterns versus Metaprogramming

The main objective of this chapter is to present a comparative study of two techniques that automatically generate useful knowledge in games. Retrograde analysis of patterns generates pattern databases, starting with a simple definition of a sub-goal in a game and progressively finding all the pattern of given sizes that fulfill this sub-goal. Metaprogramming is based on similar concepts, but i...

متن کامل

Embodied genomes and metaprogramming

We model some of the crucial properties of biological novelty generation, and abstract these out into minimal requirements for an ALife system that exhibits constant novelty generation (open ended evolution) combined with robustness. The requirements are an embodied genome that supports runtime metaprogramming (‘self modifying code’), generation of multiple behaviours expressible as interfaces,...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2003