ABSTRACT
A PEC is a Pattern Enforcing Compiler, which is like a conventional compiler only extended to include the extra checks needed to enforce design patterns. PECs are currently a research project and the PEC written is targeted at the Java programming language. This paper:• Describes the PEC• Describes how to use the PEC• Demonstrates how the PEC combines static testing, dynamic testing (unit testing), and code generation synergistically into one utility• Shows that the user of the PEC can write their own design patterns and have the compiler enforce them• The PEC is believed to be unique in statically testing, dynamically testing, generating code and being user extendable.• The PEC is stable enough for production code and is available for free <u>download</u> under the Lesser GNU General Public License (Lovatt 2004).The PEC makes extensive use of reflection (runtime type identification); both when testing that a class conforms to pattern and also to allow the compiler to be user extendable.
References
- Bloch, J. (2001): Effective Java#8482;: Programming Language Guide. Addison-Wesley Publishing Co., Inc., Boston, MA. ISBN 0201310058. Google Scholar
Digital Library
- Bokowski, B. (1999): CoffeeStrainer: Statically-Checked Constraints on the Definition and Use of Types in Java. Proceedings of the 7th European software engineering conference held jointly with the 7th ACM SIGSOFT international symposium on Foundations of software engineering (ESEC/FSE'99). Toulouse, France. Pages: 355 -- 374. ftp://ftp.inf.fu-berlin.de/pub/barat/esec-final.ps. Accessed 15 Aug. 2004. Google Scholar
Digital Library
- Bonniot, D. (2004): The Nice programming language. http://nice.sourceforge.net/. Accessed 15 Aug. 2004.Google Scholar
- Budinsky, F., Finnie, M., Patsy, Y., and Vlissides, J. (1996): Automatic Code Generation from Design Patterns. IBM Systems Journal, Vol. 35(2). Pages: 151 -- 171. http://www.research.ibm.com/designpatterns/pubs/code gen.pdf. Accessed 15 Aug. 2004. Google Scholar
Digital Library
- Chambers, C., Harrison, W., and Vlissides, J. (2000): A Debate on Language and Tool Support for Design Patterns. Proceedings of the 27th ACM SIGPLAN-SIGACT symposium on Principles of programming languages. Boston, MA, USA. Pages: 277 -- 289. http://doi.acm.org/10.1145/325694.325731. Accessed 15 Aug. 2004. Google Scholar
Digital Library
- Chiba, S. (2004): Javassist Home Page. http://www.csg.is.titech.ac.jp/~chiba/javassist/. Accessed 15 Aug. 2004.Google Scholar
- Coplien, J. O. (1998): Software Design Patterns: Common Questions and Answers. In Linda Rising, editor, The Patterns Handbook: Techniques, Strategies, and Applications, Pages: 311 -- 320. Cambridge University Press, New York, January 1998. Google Scholar
Digital Library
- Cornils, A. and Hedin, G. (2000): Statically Checked Documentation with Design Patterns. Proceedings of the Technology of Object-Oriented Languages and Systems (TOOLS 33). Page: 419. http://www.cs.lth.se/Research/ProgEnv/Papers/TOOLS 00.GH.pdf. Accessed 15 Aug. 2004. Google Scholar
Digital Library
- Gamma, E., Helm, R., Johnson, R., and Vlissides, J. (1995): Design patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley Longman Publishing Co., Inc., Boston, MA. ISBN 0-201-63361-2 Google Scholar
Digital Library
- Hammouda, I. and Koskimies, K. (2002): Generating a Pattern-Based Application Development Environment for Enterprise JavaBeans. Proceedings of the 26th International Computer Software and Applications Conference on Prolonging Software Life: Development and Redevelopment (COMPSAC). Pages: 856 -- 866. http://practise.cs.tut.fi/pub/papers/NWPER02 Imed.pdf. Accessed 15 Aug. 2004. Google Scholar
Digital Library
- Hannemann, J. and Kiczales, G. (2002): Design Pattern Implementation in Java and AspectJ. Proceedings of the 17th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications. Seattle, Washington, USA. Nov. Pages: 161 -- 173. http://www.cs.ubc.ca/~jan/papers/oopsla2002/oopsla02-patterns.pdf. Accessed 9 Nov. 2004. Google Scholar
Digital Library
- Hedin, G. (1996): Enforcing programming conventions by attribute extension in an open compiler. In Proceedings of the Nordic Workshop on Programming Environment Research (NWPER'96), Aalborg, Denmark, http://www.cs.lth.se/Research/ProgEnv/Papers/LU-CS-TR:96-171.pdf. Accessed 15 Aug. 2004.Google Scholar
- Lovatt, H. C. (2001): Bug ID: 4617197 RFE: Add Immutable types to Java. http://bugs.sun.com/bugdatabase/view bug.do?bug id =4617197. Accessed 15 Aug. 2004.Google Scholar
- Lovatt, H. C. (2004): pec: Pattern Enforcing Compiler(TM) (PEC(TM)) Home Page. http://pec.dev.java.net/. Accessed 15 Aug. 2004.Google Scholar
- Mapelsden, D., Hosking, J., and Grundy, J. (2002): Design Pattern Modeling and Instantiation using DPML. Proceedings of Tools Pacific 2002, Sydney, 18--21 Feb., CRPIT Press. https://www.se.auckland.ac.nz/courses/SOFTENG462/resources/jg/tools2002.pdf. Accessed 9 Nov. 2004. Google Scholar
Digital Library
- Meijer, E. and Schulte, W. (2003): Unifying Tables Objects and Documents. http://research.microsoft.com/~emeijer/Papers/XS.pdf. Accessed 15 Aug. 2004.Google Scholar
- Murphy, G. C., Notkin, D., and Sullivan, K. (1995): Software Reflexion Models: Bridging the Gap between Source and High-Level Models. Proceedings of the 3rd ACM SIGSOFT symposium on Foundations of software engineering. Washington, D. C., United States. Pages:18--28. http://www.cs.ubc.ca/spider/murphy/papers/rm/fse95.html. Accessed 15 Aug. 2004. Google Scholar
Digital Library
- Noble, J. and Biddle, R. (2002): Patterns as Signs. Proceedings of the 16th European Conference on Object-Oriented Programming (ECOOP2002). Pages: 368 -- 391. Similar to http://www.mcs.vuw.ac.nz/comp/Publications/archive/CS-TR-01/CS-TR-01-16.pdf. Accessed 2 Nov. 2004. Google Scholar
Digital Library
- Relaxed MultiJava (2004): The MultiJava Project. http://multijava.sourceforge.net/. Accessed 15 Aug. 2004.Google Scholar
- Rutar, N., Almazan, C. B., and Foster, J. S. (2004): A Comparison of Bug Finding Tools for Java. To be published in the proceedings of The 15th IEEE International Symposium on Software Reliability Engineering (ISSRE'04). Saint-Malo, Bretagne, France., Nov., http://www.cs.umd.edu/~jfoster/papers/issre04.pdf. Accessed 9 Nov. 2004. Google Scholar
Digital Library
- Sefika, M, Sane, A, and Campbell R. H. (1996): Monitoring Compliance of a Software System with its High-Level Design Models. Proceedings of the 18th international conference on Software engineering. Berlin, Germany. Pages: 387 -- 396 http://choices.cs.uiuc.edu/Papers/SoftwareEngineering/icse-96.pdf. Accessed 15 Aug. 2004. Google Scholar
Digital Library
- Sloane, A. M. (2004): Programming Languages Reading Group Home Page. http://www.comp.mq.edu.au/~asloane/plrg/reading/index.html. Accessed 15 Aug. 2004.Google Scholar
- Steele, G. L. (1998): Growing a Language. Object-Addendum to the 1998 proceedings of the conference on Object-oriented programming, systems, languages, and applications (Addendum to OOPSLA'98). Vancouver, BC, Canada. http://research.sun.com/research/jtech/pubs/98-oopsla-growing.ps. Accessed 15 Aug. 2004. Google Scholar
Digital Library
- Sun Microsystems Inc. (2003): Java#8482; 2 Platform, Standard Edition, v 1.4.2 API Specification. http://java.sun.com/j2se/1.4.2/docs/api/index.html. Accessed 15 Aug. 2004.Google Scholar
- Wallace, B. (2003): PolyGlot, Inc. Design Markers. http://www.polyglotinc.com/DesignMarkers/. Accessed 15 Aug. 2004.Google Scholar
Index Terms
A pattern enforcing compiler (PEC) for Java: using the compiler


Anthony M. Sloane

Comments