Child pages
  • Implementing Business Logic

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Note
titleNote

Developers who are familiar with Javascript may cite issues with browser support and speed of execution.

However, it is worth noting that Servoy does not deploy any Javascript. All code written in Servoy is deployed using Mozilla's Rhino project, which is an open-source, Java-based Javascript implementation.

This means that:

  1. All methods are executing in Java (orders of magnitude faster than interpreted Javascript)
  2. No business logic is ever exposed or executed in the browser, thereby eliminating browser support issues.
  3. Experienced developers can optionally use 3rd-party java APIs, mixing Java code directly in their Servoy methods.
Javascript Scopes

Scope defines the domain in which code is executed and subsequently determines the namespace by which elements are accessed. Javascript code (functions and variables) may be defined in the following two scopes:

  1. Global Scope: Accessible via the namespace globals, i.e.
    Code Block
    langjavascript
    globals.createNewCustomer(); // invokes the global method
    When referencing a global
  2. Form Scope: Accessible via the namespace forms.formName, i.e.
    Code Block
    langjavascript
    forms.customers.createNewCustomer;  // invokes the form method from another scope