`

Compilation and Execution (openlaszlo)

阅读更多

7. Compilation and Execution

LZX programs are compiled by the OpenLaszlo Compiler, downloaded as byte code, and executed on the client. In writing your program you can make trade-offs between compilation performance, download and startup up time, and runtime performance.

As in other scripting languages such as Perl and Python, LZX programs execute in approximately linear order. That is to say, if you were to write

<view name="outside"> 
  <view name="inside"/> 
</view>

Then inside would be built before outside. However in many cases you may wish to control the order in which objects are built, or initialized. LZX gives you fine grained control over initialization and instantiation of views.

The <splash> tag allows you use the canvas to display information while the program is being initialized.

 

8. On Runtimes and Deployment Modes and the "Core" API

Note
[Note]

The following section also appears in the Preface; we repeat it here on the assumption that the Preface is an often-skipped part of any manual.

OpenLaszlo applications can be compiled to run in any of several runtimes, and in either of two deployment modes. Some capabilities are available in only a subset of these use cases. OpenLaszlo's "core" APIs run on all target runtimes, and they get the most attention in this Guide. The "Core API" is kind of loose concept, since there's no formal definition, but what it means is that unless you see indication to the contrary, you can assume that the topic under discussion applies to all runtimes. Similarly the default deployment mode is assumed to be SOLO.

Nevertheless, as a developer you have to decide whether to:

  1. optimize for swf (employ swf-only APIs, (and maybe even touch Flash APIs))

  2. optimize for dhtml (employ dhtml-only APIs)

  3. code to lowest common denominator ("core" APIs only)

  4. conditionalize (include both. An example would be including comma separated list of embedded and system fonts; when compiled to SWF you get embedded font, to DHTML you get system font).

The focus of the OpenLaszlo Application Developer's Guide is (c), the lowest common denominator; runtime-specific APIs and engineering approaches are presented as adjuncts. Graphic devices ("glyphs") in the margin call attention to non core/non SOLO information.

Depending on which approach you're taking, you'll make different engineering decisions and different approaches to reading the this Guide. For example, if you're determined to deploy SOLO, you can just skip all the chapters marked with the "Server Required" device, etc.

Finally, this Guide does not address any browser-specific considerations. If a thing does not run on all supported browsers for a given runtime, it's by definition not supported and thus should not be cluttering up our lovely Guide. Nonstandard, browser-specific things are described in the release notes or the OpenLaszlo Wiki.

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics