@Rythm

Yet Another Template Engine and Why


Green Luo


Senior Programmer @ Pixolut

Lead Developer of CampaignSocial


First commercial program: Year 2000

First Java Program: Year 2000

First Template Engine used: Velocity @ 2001 


Agenda


  • Template Engine

  • Rythm Introduction

  • Feature Demo

  • Wrap up
 

Template Engine

Why create Rythm

 

I need a Razor in Java

Rythm at a glance



Rythm at a glance

Hello World

Flow Control



If/else

for loop

transformer

  • Manipulate expressions
  • See more built-in transformers on Rythm website

Extensibility


Call other Template

define local functions

Reuse layout

User defined transformer



REGISTER UDT

i18n

smart Escaping

Natural Template

Security



Substitute Mode
 String s = Rythm.substitute(unTrustedTemplate, ...)

Sandbox Mode
 String s = Rythm.sandbox().render(unTrustedTemplate, ...);

Performance


https://github.com/greenlaw110/template-engine-benchmarks

Rythm is the third fast template engine, only after beetl and httl

Summary

Razor like syntax
Static typed
High performance
Easy to use
Highly extensible
Secure
Built-in i18n support

Success story - Campaign social














CampaignSocial is a cloud for Media Agents to create their campaigns and run them on multiple channels including Facebook, Mobile, Tablet and MicroSite


success story - AX UNICOM




AX Unicom platform is an enterprise level universal communication system supporting PSTN, E1 lines. AX Unicom support collaboration among telephone, VOIP, Video Conference, FAX and SMS. The product attend 2013 CEBIT in German and win the 2012 top 200 innovation award in China
 

Links

Q/A

 

Numbers

Rythm first version
  • File: 83
  • Code lines: 3810
Rythm current version
  • File: 265
  • Code lines: 22092
  • Comments: 11627
Github
  • Issues closed: 163
  • Open issues: 17
  • Commits: 396

A Tale of Rythm

Rythm - Yet Another Template Engine and Why

By Gelin Luo

Rythm - Yet Another Template Engine and Why

Introduce Rythm Template Engine and tell the story behind it

  • 1,713