ZK Framework has been a popular choice for Java web development since 2005. It pioneered server-side component architecture but requires learning ZUML, a proprietary XML-based UI language. Oorian offers a different approach: pure Java all the way.
The Core Difference: ZUML vs Pure Java
ZK's ZUML Approach
<?page title="Customer List"?>
<window title="Customers" border="normal">
<listbox id="customerList" model="${vm.customers}">
<listhead>
<listheader label="Name" />
<listheader label="Email" />
</listhead>
<template name="model">
<listitem>
<listcell label="${each.name}" />
<listcell label="${each.email}" />
</listitem>
</template>
</listbox>
<button label="Add" onClick="@command('add')" />
</window>
Oorian's Pure Java Approach
@Page("/customers")
public class CustomerListPage extends HtmlPage
{
@Override
protected void createBody(Body body)
{
Div window = createWindow("Customers");
AgGrid grid = new AgGrid();
grid.setRowData(customerService.findAll());
grid.addColumn("name", "Name");
grid.addColumn("email", "Email");
window.addElement(grid);
Button addButton = new Button("Add");
addButton.registerListener(this, MouseClickedEvent.class);
window.addElement(addButton);
body.addElement(window);
}
}
Why Pure Java Matters
1. Full IDE Support
With Oorian, your IDE knows everything. Autocomplete works for all properties. Refactoring updates all references. Compile-time errors catch typos before runtime.
ZUML is XML. Your IDE can validate syntax, but it can't help with component properties or catch typos in attribute names until runtime.
2. Type Safety
// Oorian: Compile-time error if method doesn't exist
grid.setAllowSorting(true);
// ZK ZUML: Runtime error if attribute is misspelled
<listbox allowSortng="true" /> <!-- Typo not caught until runtime -->
3. Inheritance and Polymorphism
Pure Java means you can use OOP fully:
public abstract class BaseCrudPage<T> extends HtmlPage
{
protected abstract AgGrid createGrid();
protected abstract void handleSave(T entity);
@Override
protected void createBody(Body body)
{
body.addElement(createGrid());
body.addElement(createToolbar());
}
}
public class CustomerPage extends BaseCrudPage<Customer>
{
@Override
protected AgGrid createGrid()
{
AgGrid grid = new AgGrid();
grid.addColumn("name", "Name");
// Customer-specific columns
return grid;
}
}
4. No Context Switching
With Oorian, everything is Java. With ZK, you're constantly switching between ZUML, Java composers, and EL expressions.
Feature Comparison
| Feature | ZK | Oorian |
|---|---|---|
| UI Definition | ZUML (XML) + Java | Pure Java |
| Components | Proprietary ZK components | 58 wrapper libraries |
| Communication | Comet/WebSocket | AJAX, SSE, or WebSocket (per page) |
| IDE Support | Limited (XML-based) | Full (pure Java) |
| Learning Curve | High (ZUML + ZK patterns) | Low (familiar Java patterns) |
When to Choose ZK
- You prefer XML-based UI definition
- You have existing ZK expertise on your team
- You're maintaining a legacy ZK application
When to Choose Oorian
- You want pure Java with full IDE support
- You need best-of-breed UI components
- You prefer OOP patterns over XML templates
- Your team knows Java but not ZUML
Conclusion
ZK pioneered server-side Java web development, but its ZUML requirement adds complexity and reduces IDE support. Oorian's pure Java approach provides full type safety, IDE support, and the flexibility to use best-of-breed UI libraries.