In java world, there are many template engine, such as Velocity, FreeMarker, and JavaServerPage.
So why we need a new Template such as NUI? In one word, they are "raw" template,
and what we need is just a clear, easy template.
The "raw" template is more powerful, and more complicated. As opposition,
NUI is a property oriented template engine, it's realy clear and easy to use.
Take a look at login UI below.
| User Login | |
| User Name: | |
| Password: | |
public class User
{
private String userName ;
private String password ;
// Omit Getter & Setter code.
}
The textbox of userName is the "Editor" of property userName,
and password textbox is the "Editor" of property password.
And what about the labels("User Name" & "Password")?
They are the "Title" of property userName and property password.
for each property of Object user
{
out ("A table row") ;
out ("A td include title of property") ;
out ("A td include editor of property") ;
}
Is't clear?