Overview"
Maya001122 (talk | contribs) m (Created page with '{{ZKDevelopersGuidePageHeader}} By default, code in <tt>zscript</tt> is Java language. Therefore, any code written in <tt>zscript</tt> can move to java file by slightly modifica…') |
m (correct highlight (via JWB)) |
||
Line 1: | Line 1: | ||
{{ZKDevelopersGuidePageHeader}} | {{ZKDevelopersGuidePageHeader}} | ||
− | By default, code in < | + | By default, code in <code>zscript</code> is Java language. Therefore, any code written in <code>zscript</code> can move to java file by slightly modification. In retrospect, any code written in java file can move to <code>zscript</code> by slightly modification. After all, they are all java. |
− | It is convenient to use < | + | It is convenient to use <code>zscript</code> in ZUML. The advantage is that no compilation is required and you can modify its content dynamically (without re-deploying the Web application). And the syntax is more intuitive, EL can access variables in <code>zscript</code> easily. |
− | But it comes with a price: slower performance. The degradation varies from one application from another. For large website, it is suggested not to use < | + | But it comes with a price: slower performance. The degradation varies from one application from another. For large website, it is suggested not to use <code>zscript</code> if possible. Also, you '''CAN NOT''' use Java debug tool to debug <code>zscript</code>, you can't set breakpoints in zscript. Not like Java, sometimes obvious bug like typo can't be easily found in <code>zscript</code>. ZK has implemented <code>GenericAutowireComposer</code>, it eases the burden of moving code from <code>zscript</code> to java a lot. Please refer to the smalltalk [http://www.zkoss.org/smalltalks/mvc3 ZK MVC Made Easy] for detail. |
− | < | + | <code>zscript</code> is useful for prototyping, but it's more hard to debug and maintain. In the following paragraph, we'll show examples of equivalent <code>zscript</code> and java code. |
{{ ZKDevelopersGuidePageFooter}} | {{ ZKDevelopersGuidePageFooter}} |
Latest revision as of 10:41, 19 January 2022
This documentation is for an older version of ZK. For the latest one, please click here.
By default, code in zscript
is Java language. Therefore, any code written in zscript
can move to java file by slightly modification. In retrospect, any code written in java file can move to zscript
by slightly modification. After all, they are all java.
It is convenient to use zscript
in ZUML. The advantage is that no compilation is required and you can modify its content dynamically (without re-deploying the Web application). And the syntax is more intuitive, EL can access variables in zscript
easily.
But it comes with a price: slower performance. The degradation varies from one application from another. For large website, it is suggested not to use zscript
if possible. Also, you CAN NOT use Java debug tool to debug zscript
, you can't set breakpoints in zscript. Not like Java, sometimes obvious bug like typo can't be easily found in zscript
. ZK has implemented GenericAutowireComposer
, it eases the burden of moving code from zscript
to java a lot. Please refer to the smalltalk ZK MVC Made Easy for detail.
zscript
is useful for prototyping, but it's more hard to debug and maintain. In the following paragraph, we'll show examples of equivalent zscript
and java code.