Validating Objects Through Metadata
Subject:   Alternative: generate AspectJ or Java code
Date:   2005-02-04 07:13:11
From:   deanwampler
This technique of adding behavior to annotations is interesting, although it begs the question why the language won't let you do it "natively". <br/>I recently implemented an alternative approach to support "Design by Contract". I use Sun's Annotation Processor Tool (APT) to parse source, looking for special annotations that define contract tests, and then I generate AspectJ code that inserts the tests in the runtime jar. See for more information.