Information about Template System

Enlarge picture
A diagram illustrating all of the basic elements and processing flow of a template engine.


A template processor (also known as a template engine or a template parser) is software or a software component that is designed to combine one or more templates with a data model to produce one or more result documents.[1] [2] [3] For purposes of this article, a result document is any kind of formatted output, including documents, web pages, or source code, either in whole or in fragments.

System elements

All template processing systems consist of at least these primary elements:
  • an associated data model;
  • one or more source templates;
  • a processor or template engine;
  • generated output in the form of result documents.

Data model

This may be a relational database, a source file such as XML, an alternate format of flat file database, a spreadsheet or any of other various sources of preformatted data. Some template processing systems are limited in the types of data that can be used. Others are designed for maximum flexibility and allow many different types of data.

Source template

Source templates are traditionally specified:
  • according to a pre-existing programming language;
  • according to a specially-defined template language;
  • according to the features of a hosting software application; or
  • according to a hybrid combination of some or all of the above.

Template engine

The template engine is responsible for:
  • connecting to the data model;
  • processing the code specified in the source templates; and
  • directing the output to a specific pipeline, text file, or stream
Additionally some template engines allow additional configuration options.

Result documents

These may consist of an entire document or a document fragment.

Uses

Template processing is used in various contexts for different purposes. The specific purpose is ordinarily contingent upon the software application or template engine in use. However, the flexibility of template processing systems often enables unconventional uses for purposes not originally intended by the original designers.

Template engine

A template engine is a specific kind of template processing module that exhibits all of the major features of a modern programming language. The term template engine evolved as a generalized description of programming languages whose primary or exclusive purpose was to process templates and data to output text. The use of this term is most notably applied to web development using a web template system, and it is also applied to other contexts as well.[4]

Document generation

Document generation frameworks typically use template processing as the central model for generating documents.

Source code generation

Source code generation tools support generation of source code (as the result documents) from abstract data models (e.g., UML, relational data, domain-specific enterprise data stores) for particular application domains, particular organizations, or in simplifying the production process for computer programmers.

Software functionality

A web template engine processes web templates and source data (typically from a relational database) to produce one or more output web pages or page fragments. It is ordinarily included as a part of a web template system or application framework. Currently, template processing software is most frequently used in the context of development for the web.

Comparison

XSLT is a template processing model designed by W3C. It is designed primarily for transformations on XML data (into web documents or other output).

Programming languages such as Perl, Python, Ruby, C, and Java support template processing either natively, or through add-on libraries and modules. JavaServer Pages,[5] and Active Server Pages[6] are examples of template engines designed specifically for web application development.

Moreover, template processing is sometimes included as a sub-feature of software packages like text editors, IDEs and relational database management systems.

Benefits of using template engines

  • encourages organization of source code into operationally-distinct layers (see e.g., MVC)
  • enhances productivity by reducing unnecessary reproduction of effort
  • enhances teamwork by allowing separation of work based on skill-set (e.g., artistic vs. technical)

References

1. ^ Niemeyer , Patrick (2002 ). Learning Java . Sebastopol : O'Reilly . ISBN 0596002858. 
2. ^ Manolescu, Dragos (2006). Pattern Languages of Program Design 5. Reading: Addison-Wesley Professional. ISBN 0321321944. 
3. ^ Fowler, Martin (2003). Patterns of Enterprise Application Architecture. Boston: Addison-Wesley. ISBN 0321127420. 
4. ^ (see e.g., Velocity, TemplateToolkit, Freemarker).
5. ^ JavaServer Pages is a technology released by Sun for use with the Java programming language. JavaServer Pages Technology (2006-10-10). Retrieved on 2006-10-10.
6. ^ ASP 1.0 was originally released for use with Microsoft VBScript and JScript. It was an extension to Microsoft IIS. .

See also

External links

Computer software is a general term used to describe a collection of computer programs, procedures and documentation that perform some task on a computer system. [1]
..... Click the link for more information.
Component-based software engineering (CBSE) (also known as Component-Based Development (CBD) or Software Componentry) is a branch of the software engineering discipline, with emphasis on decomposition of the engineered systems into functional or logical components
..... Click the link for more information.
The term template, when used in the context of software engineering has various technical specifications, but is generally identified as any processing element that can be combined with a data model and processed by a template engine to produce a result document.
..... Click the link for more information.
A data model is an abstract model that describes how data is represented and used.

The term data model has two generally accepted meanings:
  1. A data model theory i.e. a formal description of how data may be structured and used.

..... Click the link for more information.
document (noun) is a bounded physical representation of body of information designed with the capacity (and usually intent) to communicate. A document may manifest symbolic, diagrammatic or sensory-representational information.
..... Click the link for more information.
A Web page or webpage is a resource of information that is suitable for the World Wide Web and can be accessed through a web browser. This information is usually in HTML or XHTML format, and may provide navigation to other web pages via hypertext links.
..... Click the link for more information.
source code (commonly just source or code) is any sequence of statements and/or declarations written in some human-readable computer programming language.
..... Click the link for more information.
Extensible Markup Language

File extension: .xml
MIME type: application/xml, text/xml (deprecated)
Uniform Type Identifier: public.xml
Developed by: World Wide Web Consortium
Type of format: Markup language
Extended from: SGML
..... Click the link for more information.
flat file database describes any of various means to encode a data model (most commonly a table) as a plain text file.

Flat files

A flat file is a file that contains records, and in which each record is specified in a single line.
..... Click the link for more information.
spreadsheet is a rectangular table (or grid) of information, often financial information. The word came from "spread" in its sense of a newspaper or magazine item (text and/or graphics) that covers two facing pages, extending across the center fold and treating the two pages as one
..... Click the link for more information.
pipeline is a set of data processing elements connected in series, so that the output of one element is the input of the next one. The elements of a pipeline are often executed in parallel or in time-sliced fashion; in that case, some amount of buffer storage is often inserted
..... Click the link for more information.
text file.]]

A text file is a generic description of a kind of computer file in a computer file system.[1] At this generic level of description, there are two kinds of computer files: 1) text files; and 2) binary files.
..... Click the link for more information.
stream is used in a number of ways, in all cases referring to a succession of data elements made available over time.
  • On Unix and related systems based on the C programming language, a stream is a source or sink of data, usually individual bytes or characters.

..... Click the link for more information.
Application software is a subclass of computer software that employs the capabilities of a computer directly and thoroughly to a task that the user wishes to perform. This should be contrasted with system software which is involved in integrating a computer's various capabilities,
..... Click the link for more information.
A programming language is an artificial language that can be used to control the behavior of a machine, particularly a computer. Programming languages, like natural languagess, are defined by syntactic and semantic rules which describe their structure and meaning respectively.
..... Click the link for more information.
Web development is a broad term for any activities related to developing a web site for the World Wide Web or an intranet. This can include e-commerce business development, web design, web content development, client-side/server-side coding, and web server configuration.
..... Click the link for more information.
A Web template system describes the software and methodologies used to produce web pages and for deployment on websites and delivery over the internet. Such systems process web templates, using a template engine.
..... Click the link for more information.
source code (commonly just source or code) is any sequence of statements and/or declarations written in some human-readable computer programming language.
..... Click the link for more information.
programmer or software developer is someone who programs computers, that is, one who writes computer software. The term computer programmer can refer to a specialist in one area of computer programming or to a generalist who writes code for many kinds of software.
..... Click the link for more information.
World Wide Web (commonly shortened to the Web) is a system of interlinked, hypertext documents accessed via the Internet. With a web browser, a user views web pages that may contain text, images, videos, and other multimedia and navigates between them using hyperlinks.
..... Click the link for more information.
A relational database is a database that conforms to the relational model, and refers to a database's data and schema (the database's structure of how that data is arranged).
..... Click the link for more information.
A Web page or webpage is a resource of information that is suitable for the World Wide Web and can be accessed through a web browser. This information is usually in HTML or XHTML format, and may provide navigation to other web pages via hypertext links.
..... Click the link for more information.
A Web template system describes the software and methodologies used to produce web pages and for deployment on websites and delivery over the internet. Such systems process web templates, using a template engine.
..... Click the link for more information.
In computer programming, an application framework is a software framework that is used to implement the standard structure of an application for a specific operating system.
..... Click the link for more information.
WEB is a computer programming system created by Donald Knuth as the first implementation of what he called "literate programming": the idea that one could create software as works of literature, by embedding source code inside descriptive text, rather than the reverse (as is common
..... Click the link for more information.
XSL Transformations

File extension: .xsl, .xslt
MIME type: application/xslt+xml[1]
Developed by: World Wide Web Consortium
Type of format: Stylesheet language
Extended from: XML
..... Click the link for more information.
World Wide Web Consortium

Consortium
Founded October 1994
Founder Tim Berners-Lee
Headquarters MIT/CSAIL in USA
ERCIM in France
Keio University in Japan
and many other offices around the world

Website www.w3.
..... Click the link for more information.
Extensible Markup Language

File extension: .xml
MIME type: application/xml, text/xml (deprecated)
Uniform Type Identifier: public.xml
Developed by: World Wide Web Consortium
Type of format: Markup language
Extended from: SGML
..... Click the link for more information.
This article may contain original research or unverified claims.
Please help Wikipedia by adding references. See the for details.
This article has been tagged since September 2007.

..... Click the link for more information.
A programming language is an artificial language that can be used to control the behavior of a machine, particularly a computer. Programming languages, like natural languagess, are defined by syntactic and semantic rules which describe their structure and meaning respectively.
..... Click the link for more information.


This article is copied from an article on Wikipedia.org - the free encyclopedia created and edited by online user community. The text was not checked or edited by anyone on our staff. Although the vast majority of the wikipedia encyclopedia articles provide accurate and timely information please do not assume the accuracy of any particular article. This article is distributed under the terms of GNU Free Documentation License.
Herod_Archelaus


page counter