Home

[ Syntax | Examples | License ]

DUEL

The ‘ V ’ in MVC…

DUEL is a dual-side templating engine using HTML for layout and 100% pure JavaScript as the binding language. The same views may be executed both directly in the browser (client-side template) and on the server (server-side template).

The goal of DUEL is to leverage knowledge in existing technologies to build UI for Ajax web applications. Modern apps require a fluid UI meaning an investment in JavaScript. DUEL takes this one step further by enabling JavaScript to build the entire view. Less context switching means focusing on the real problems rather than fighting the tools.

In the browser…

The view becomes a JavaScript function which accepts the data to bind as an argument. Returned is a result which can be used as either a string or to produce DOM elements directly. DUEL works great with your favorite JavaScript library (e.g. jQuery).

On the server…

The view is translated into a class which may be natively executed on the server without requiring a JavaScript execution environment. If any code blocks require being executed on the client they will be automatically delegated to the client. Initially, DUEL targets Java as the server language. Goals for the future include expansion into other environments as well.

Syntax

The syntax for DUEL views is designed to be familiar, concise and easy to remember.

Examples

See examples of how easy it is to define and use DUEL views.

History

DUEL is an evolution of previous view template technologies that began in 2006 with JsonML. JsonML paved the way for JBST which was an early client-side template technology. After several years of real world usage, DUEL is the refinement of the good ideas of JBST while adding a viable server-side companion to the concept.

License

DUEL is licensed under the MIT license. Copyright ©2006-2010 Stephen M. McKamey.

Updated

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.