You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by jo...@locus.apache.org on 2000/08/26 20:58:17 UTC
cvs commit: jakarta-velocity/docs design.html
jon 00/08/26 11:58:16
Modified: docs design.html
Log:
added some documentation about the design
Revision Changes Path
1.6 +37 -0 jakarta-velocity/docs/design.html
Index: design.html
===================================================================
RCS file: /home/cvs/jakarta-velocity/docs/design.html,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- design.html 2000/08/26 00:19:51 1.5
+++ design.html 2000/08/26 18:58:16 1.6
@@ -1,13 +1,23 @@
<HTML><HEAD><SCRIPT language="JavaScript" src="resources/script.js" type="text/javascript"></SCRIPT><TITLE>Velocity Design</TITLE></HEAD><BODY alink="#023264" bgcolor="#ffffff" leftmargin="4" link="#023264" marginheight="4" marginwidth="4" text="#000000" topmargin="4" vlink="#023264"><TABLE border="0" cellpadding="0" cellspacing="0" width="100%"><TR><TD align="left" valign="top"><A href="http://jakarta.apache.org/index.html"><IMG border="0" hspace="0" src="resources/jakarta-logo.gif" vspace="0"></A></TD><TD align="left" bgcolor="#ffffff" valign="top" width="100%"><IMG align="right" alt="" border="0" hspace="0" src="resources/header.gif" vspace="0"></TD></TR><TR><TD><IMG border="0" height="5" hspace="0" src="resources/void.gif" vspace="0" width="5"></TD></TR><TR><TD background="resources/line.gif" colspan="2" height="2" width="100%"><IMG alt="" border="0" height="2" hspace="0" src="resources/line.gif" vspace="0" width="1"></TD></TR></TABLE><TABLE border="0" cellpadding="0" cellspacing="0" width="100%"><TR>
<TD valign="top" width="1%"></TD><TD nowrap="1" valign="top" width="14%"><BR>
+
+
<P></P>
+
<FONT face="arial,helvetica,sanserif" size="-1"><LI><A href="index.html">Overview</A></LI></FONT>
+
<FONT face="arial,helvetica,sanserif" size="-1"><LI><A href="getting-started.html">Getting Started</A></LI></FONT>
+
<FONT face="arial,helvetica,sanserif" size="-1"><LI><A href="install.html">Install</A></LI></FONT>
+
<FONT face="arial,helvetica,sanserif" size="-1"><LI><A href="design.html">Design</A></LI></FONT>
+
<FONT face="arial,helvetica,sanserif" size="-1"><LI><A href="contributors.html">Contributors</A></LI></FONT>
+
<FONT face="arial,helvetica,sanserif" size="-1"><LI><A href="code-standards.html">Coding Standards</A></LI></FONT>
+
<FONT face="arial,helvetica,sanserif" size="-1"><LI><A href="license.html">License</A></LI></FONT>
+
</TD><TD align="left" valign="top" width="*"><TABLE border="0" cellpadding="3" cellspacing="0"><TR><TD><BR>
@@ -26,6 +36,33 @@
to provide a template service that will enable a true MVC model
by which web applications may be developed.
</P>
+
+<P align="justify">The fundamental design of Velocity is around the idea that there are a few
+useful tag elements that you embed within your HTML code that work in
+conjunction with a Context object that is populated in your Java code. The
+purpose of the Context object is to provide a "hook" from your Java
+code to your WebMacro code. Essentially a Context object is simply a Hashtable
+which provides get and set methods for retrieving and setting objects by name
+within the Context. These tag elements provide enough basic functionality to
+allow you to retrieve objects from the Context and put them into your page as
+text values with some degree of control over looping (for each) and conditional
+statements (if/else). </P>
+
+<P align="justify">For people who are not familiar with MVC style of development, at first
+glance, it will appear as though Velocity is missing a large set of
+functionality. It turns out that this is actually the strength of Velocity. For
+example, unlike JSP, there is no way to embed Java code within your page and the
+tag elements provide little more than basic looping and conditional statements.
+Another example is the PHP model where every single feature is implemented with
+another function. So, how is this better than the alternatives? The answer is
+that by using Velocity, you are enforcing a MVC style of development which
+defines that your Java code and your HTML template code should be separate.
+This style of development sometimes takes slightly longer (especially if you are
+new to MVC), but results in much more maintainable code over the long term
+(believe us, we have been doing this for a long time now). It also provides an
+abstraction that prevents page designers from messing with software engineer's
+Java code. In other words, it provides an enforcement of a contract that defines
+what roles people play in the development process.</P>
</FONT></TD></TR></TABLE></DIV><BR>