Treffer: A pattern enforcing compiler (PEC) for Java:a practical way to formally specify patterns

Title:
A pattern enforcing compiler (PEC) for Java:a practical way to formally specify patterns
Contributors:
Taibi, Toufik
Source:
Lovatt , H , Sloane , A M & Verity , D R 2007 , A pattern enforcing compiler (PEC) for Java : a practical way to formally specify patterns . in T Taibi (ed.) , Design pattern formalization techniques . IGI Publishing , Hershey, PA; London , pp. 324-356 . https://doi.org/10.4018/978-1-59904-219-0.ch015
Publisher Information:
IGI Publishing
Publication Year:
2007
Document Type:
Buch book part
Language:
English
ISBN:
978-1-59904-219-0
1-59904-219-3
Relation:
urn:ISBN:9781599042190
DOI:
10.4018/978-1-59904-219-0.ch015
Rights:
info:eu-repo/semantics/restrictedAccess
Accession Number:
edsbas.69F204EC
Database:
BASE

Weitere Informationen

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.