zk framework is very flexible for web developers. But flexibility also brings some issues. I wonder which method is the best for performance (memory, time etc.)
1) .zul files, that consists scripts like :
<vbox>
Auto-complete Combobox:
<combobox id="combo" autodrop="true" mold="rounded"/>
<hbox>
<checkbox checked="true"
onCheck="combo.autodrop = self.checked"
label="auto drop popup when typing" />
<checkbox checked="true"
onCheck="combo.buttonVisible = self.checked" label="button visible" />
</hbox>
<checkbox label="Use rounded combobox" checked="true"
onCheck='combo.mold=self.checked? "rounded": "default"'/>
</vbox>
<zscript>
String[] _dict = {
"abacus", "accuracy", "acuity", "adage", "afar", "after", "apple",
"bible", "bird", "bingle", "blog"
...
2) pure java like
public class TestRenderer {
ListModelList model = new ListModelList();
private AnnotateDataBinder binder;
@AfterCompose
public void afterCompose(@ContextParam(ContextType.VIEW) Component view) {
binder = new AnnotateDataBinder(view);
List persons = new ArrayList();
model.add(new Person("David", "Coverdale"));
...
3) hybrid zk
<window apply="com.synnex.wms.outbound.so.IndexViewCtrl">
<style>
.z-row-cnt .z-label {
white-space:nowrap;
}
</style>
<grid model="${model}" rowRenderer="${renderer }" height="300px" width="800px">
<custom-attributes org.zkoss.zul.grid.rod="true" />
<custom-attributes org.zkoss.zul.grid.initRodSize="20" />
<columns>
<column forEach="${headers}" label="${each}" width="80px"/>
</columns>
</grid>
</window>
are they differ when using with different technologies like spring? is java to html parsing faster than zul to html?
Also notice that the evaluation of EL expressions is very fast, so EL can be used in a production system. On the other hand, zscript is suggested to use only in prototyping or quick-fix.
Link
So do not use 1)
2) can be faster, slower or as fast as 3) depends on your impl.,
but to be faster may takes much time and so 2) isn't a really good idea.
3) is usually the best, cos a zul file is much more readeable then java code
and GUI logic and GUI structure are not (that much) mixed up.
To choose between MVC and MVVM read this.
If you think it makes sense to mix them, there should
be no problem with the framework.