Download Report
Transcript
CONTENTS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 28 29 32 33 34 35 36 37 39 39 40 40 41 42 43 44 5 Installation and user manual 5.1 What is 3E? . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2 How to use 3E . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2.1 Specifying an example input file . . . . . . . . . . . . 5.2.2 Using Ant . . . . . . . . . . . . . . . . . . . . . . . . 5.3 Installing 3E . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.3.1 System requirements . . . . . . . . . . . . . . . . . . 5.3.2 Installing 3E . . . . . . . . . . . . . . . . . . . . . . 5.4 Developer’s guide . . . . . . . . . . . . . . . . . . . . . . . . 5.4.1 Elements in the XML input file . . . . . . . . . . . . 5.4.2 Exceptions when running 3E . . . . . . . . . . . . . . 5.4.3 Specifying an XML input file for database connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 46 47 47 48 49 49 49 50 50 56 58 6 Technical description 6.1 Structure of 3E source code . . . . . . . . . . . . . . . . . . . . . 6.2 XML Schema for an application specification expressed in XML . 6.3 Mapping files needed by Castor XML . . . . . . . . . . . . . . . 6.4 Implementation of the application model . . . . . . . . . . . . . . 6.5 Visitors for checking and completing the application model . . . . 6.5.1 The five concrete visitor classes . . . . . . . . . . . . . . 6.5.2 The static helper methods . . . . . . . . . . . . . . . . . 6.5.3 Possible improvements and extensions . . . . . . . . . . . 6.6 Velocity Templates used for code generation . . . . . . . . . . . . 6.6.1 The Velocity language . . . . . . . . . . . . . . . . . . . 6.6.2 Template layout and formatting of generated output . . . . 6.6.3 Velocity macros . . . . . . . . . . . . . . . . . . . . . . . 6.6.4 The Utility class . . . . . . . . . . . . . . . . . . . . . . 6.6.5 How automatic generation of primary keys is implemented 6.6.6 How compound keys are generated . . . . . . . . . . . . 6.6.7 How to create a new template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 59 61 62 63 64 64 66 67 67 67 68 69 69 69 70 71 4.5 4.6 4.7 4.8 4.4.1 XML Parsers . . . . . . . . . . . . . . . . . . 4.4.2 Some options . . . . . . . . . . . . . . . . . . 4.4.3 Castor XML . . . . . . . . . . . . . . . . . . The application model . . . . . . . . . . . . . . . . . How to process information in the application model . 4.6.1 The Visitor Pattern . . . . . . . . . . . . . . . Generating Java and XML from the application model 4.7.1 JSP and Tag Libraries . . . . . . . . . . . . . 4.7.2 Velocity . . . . . . . . . . . . . . . . . . . . . 4.7.3 Choosing a code generation technology . . . . 4.7.4 More about how Velocity works . . . . . . . . Design of specific features . . . . . . . . . . . . . . . 4.8.1 Automatic generation of primary keys . . . . . 4.8.2 Supporting compound keys . . . . . . . . . . . 4.8.3 Representing relations between Entity Beans . 4.8.4 Generating debug messages . . . . . . . . . . 4.8.5 Read from database . . . . . . . . . . . . . . . 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .