Clone wiki

duel / Home

[ Syntax | Examples | License ]


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.


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


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


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.


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