File: design.xml

package info (click to toggle)
velocity 1.4-5
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, lenny
  • size: 17,900 kB
  • ctags: 9,916
  • sloc: java: 24,335; xml: 17,188; sh: 99; lisp: 53; makefile: 16
file content (100 lines) | stat: -rw-r--r-- 3,938 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<?xml version="1.0"?>

<!--
   Copyright 2000-2004 The Apache Software Foundation

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
-->


<document>

 <properties>
  <title>Velocity Design</title>
  <author email="jvanzyl@zenplex.com">Velocity Documentation Team</author>
 </properties>

 <body>

 <section name="Design">

 <p>
    Velocity is a Java-based template engine. It can be used as a
    standalone utility for generating source code, HTML, reports,
    or it can be combined with other systems to provide template
    services. Velocity will be tightly integrated with the
    <a href="http://java.apache.org/turbine">Turbine</a>
    web application framework. Velocity-Turbine
    provide a template service by which web applications may be
    developed according to a true MVC model.
 </p>

 <p>
    Velocity has a myriad of potential uses -- generating SQL, PostScript,
    or Java source code from templates -- but web developers looking for
    a viable alternative to
    <a href="http://www.php.net/">PHP</a> and
    <a href="http://java.sun.com/products/jsp/">Java
    Server Pages</a> (JSPs) are expected to be its principle user group.
 </p>

 <p>
    Velocity allows web page designers to embed simple yet powerful script
    elements in their web pages. These script elements work
    in conjunction with a Context object, which is defined in Java code.
    A context object--essentially a hashtable that provides get and set
    methods for retrieving and setting objects by name within the Context
    --provides a &quot;hook&quot; from the Java code to the Velocity script
    elements. These script elements allow a web designer to retrieve
    objects from the Context and insert these into a web page as text
    values. The web designer has some control over looping (for each)
    and conditional statements (if/else).
 </p>

 <p>
    Velocity enforces a Model-View-Controller (MVC) style of development
    by separating Java code from HTML template code. Unlike JSPs,
    Velocity does not allow Java code to be embedded in pages. Unlike PHP,
    Velocity does not implement features with other functions. The MVC
    approach is one of Velocity's great strengths, and allows for more
    maintainable and better-designed web pages.
 </p>

 <p>
    Although MVC-style development can sometimes lead to longer incubation
    periods for web sites, particularly if the developers involved are new
    to MVC, this approach saves time over the long term (believe us, we have
    been doing this for a long time now). The MVC abstraction prevents web page
    designers from messing with a software engineer's Java code, and
    programmers from unduly influencing the look of web sites. Velocity enforces
    a contract that defines what roles people play in the web site development
    process.
 </p>

 <p>
    Velocity uses a grammar-based parser generated by
    <a href="http://www.metamata.com/javacc/">JavaCC</a> (Java Compiler
    Compiler) using the JJTree extension to create an Abstract Syntax Tree.
 </p>

 <p>
    Velocity's design concept is borrowed from <a
    href="http://www.webmacro.org/">WebMacro</a>. Those involved in the
    Velocity project acknowledge and appreciate the development and design work
    that went into the WebMacro project.
 </p>

</section>

</body>
</document>