A Pattern Enforcing Compiler (PEC) for Java: A Practical Way to Formally Specify Patterns

A Pattern Enforcing Compiler (PEC) for Java: A Practical Way to Formally Specify Patterns

Howard Lovatt, Anthony M. Sloane, Dominic R. Verity
Copyright: © 2007 |Pages: 33
DOI: 10.4018/978-1-59904-219-0.ch015
OnDemand:
(Individual Chapters)
Available
$33.75
List Price: $37.50
10% Discount:-$3.75
TOTAL SAVINGS: $3.75

Abstract

This chapter describes an extended compiler that formalizes patterns, which we call a pattern enforcing compiler (PEC). Developers use standard Java syntax to mark their classes as implementations of particular Design patterns. The compiler is then able to use reflection to check whether the classes do in fact adhere to the constraints of the patterns. The checking possible with our compiler starts with the obvious static adherence to constraints such as method presence, visibility, and naming. However, we go much further and support dynamic testing to check the runtime behavior of classes and code generation to assist in the implementation of complex patterns. The chapter gives examples of using the patterns supplied with our PEC and also examples of how to write your own patterns and have our PEC enforce these.

Complete Chapter List

Search this Book:
Reset