This chapter provides an overview of the anatomy of a Servoy solution.
The Basics
...
Concept | Basic Description |
---|---|
Solution | A Solution is a single application that can be run in any of the Servoy Clients. It contains forms, business logic and datalayer definitions. |
Modules | A |
...
Module is solution that is contained within another Solution. | |
Form | A Form is an object that provides a UI and/or contains business logic. The UI of a |
...
Form is built up of Form Parts, which in turn contain |
...
Elements. |
Form Parts are horizontal regions of the UI, like a header, a body and a footer.
Abstract Forms are forms that do not have any Form Parts. They cannot be shown in the UI, but can be used to group business logic together and/or act as a super form
Elements are UI components like fields, labels, buttons etc or container elements.
A container element is an element that allows nesting a form into another form. Servoy supports three types of containers: TabPanels, SplitPanes and TablessPanels.
Business Logic is written in JavaScript.
A Function is an individual piece of business logic. are grouped together in scopes. Inside a Servoy solution, there is the solution-wide globals scope and multiple form scopes: one for each form.
The datalayer definitions inside a solution are valuelists and relations.
ValueLists are objects to translate internal values of the solutions into displayable values that make sense to the user. For example the translation of an product_id to a product_description value
Relations are links between 2 datasources.
A datasource is typically a table in a database. Each column in the table is called a dataprovider inside Servoy. Besides dataproviders that are columns in tables in a database, other types of dataproviders are: calculations, aggregations, global and form variables.
A Calculation is a dataprovider on datasource level, who's value is calculated by business logic. Calculations come in two varieties: stored and unstored.
A stored calculation is a calculation of which the value is also stored in a column in the database
An unstored calculation is a virtual dataprovider that only exists in memory
In Servoy an application is called a Solution and as such is a container for business logic and UI.
UI
A UI in Servoy is called a Form.
Business logic
The business logic, made up of variables and methods, is is organized in scopes. A solution has three distinct scope levels:
Application scope:
A solution has one application scope (also referred to as Top Level scope). This scope contains all the predefined scripting libraries that come with Servoy and also contains a customizable scope called "globals" in which custom business logic can be placed that should be accessible through the solution
Datasource scope:
Below the application scope come the datasource scopes. In general each table (or view) in a database to which the solution has access is considered a datasource. In the datasource scope extensions to the datasource can be defined, in the form of table events and calculations
Form scope:
Each form has it's own scope for business logic. If a Form is tied to a datasource, the Form scope extends from the datasource scope
In Servoy a UI is called a Form. Forms consist of Form parts and the parts contain elements, like labels, buttons and fields.
Forms can have three different layouts:
Record View:
List View:
Table View:
Abstract forms
Inheritance
Containers
application:
solutionModel:
The SolutionModel class exposes all scripting API related to the on-the-fly generation and modification at runtime of the
databaseManager:
utils:
history:
security:
i18n:
ServoyException:
jsunit:
plugins:
Abstract Form | An Abstract Form is a Form that does not implement any Form Parts and as such can not be shown to the user, but can contain business logic and can act as a Super Form for Child Forms |
Super Form | A Form that is used as a Parent for a Child Form through inheritance |
Parent Form | Alias for Super Form |
Child Form | A Form that extends another Form through inheritance |
Form Parts | Horizontal bands on the Form that together make up the vertical dimensions of a Form, like a header, body and footer. |
Form View | The "view" mode of the Form. There are three modes available:
|
Element | A UI widget that can be placed on a Form, like a Field, button, Label or TabPanel for example |
Container | A Element that can contain another another Form, like a TabPanel or SplitPane |
Bean | A UI widget that is not a core Element in Servoy, but a drop in extension to the built-in list of Elements |
UI | UI is short for User Interface. In Servoy a UI is provided by Forms with their Form Parts which contain Elements |
Media | A file object, usually images |
Media Library | The library in which Media's are stored |
Inheritance | The mechanism of creating new Forms (Child Form) that extending existing Forms (Super or Parent Form). |
Business Logic | The logic written by developers in JavaScript |
JavaScript | The scripting language used in Servoy to write business logic |
Scripting Layer | The virtual layer in the Solution where all the execution of business logic takes place |
Scripting API | The predefined set of functions by Servoy to facilitate common actions, for example the API of all the datalayer components for easy datamanipulation |
Plugin | A drop-in extension to the Scripting API |
Function | A single bit of executable logic in JavaScript |
Method | A JavaScript function that is tied to an object is called a method of that object |
Variable | A named property that can contain a value |
Scope | An JavaScript execution context within the Solution. A scope contains variables and functions. When the functions get executed they are executed withing that scope. Within Servoy there are three types of scope:
|
Globals | The toplevel scripting scope inside a Solution. |
Datasource | A datasource is the identifier for an external source of tabular data, in most cases a table from a database. |
Dataprovider | A named property that contains data. The property can be tied to a element in the UI or can be interacted with in scripting.
|
Relation | A object from the datalayer that provides the link from one datasource to another, based on one or more matches between the dataproviders in the datasource and an operator |
ValueList | An object from the datalayer that is used in the UI to provide selection lists and translations of internal values to display values |
FoundSet | A FoundSet is a represention of a datasource as an object in the Solution. Each record from the datasource is contained in the FoundSet as a Record, making the FoundSet a collection of Records. |
Record | A Record is a representation of a record in a datasource as an object in the Solution. Records are contained in FoundSets |
DataSet | A DataSet is an object with inmemory |
Calculation | A dataprovider on datasource level, who's value is calculated by business logic and is exposed as a dataprovider on each Record in Foundsets based on the datasource |
Unstored Calculation | A calculation that is not stored in the external source behind the datasource |
Stored Calculation | A calculation that is stored in the external source behind the datasource. Calculations automatically become Stored Calculations if defined with the same name as one of the columns in the external source of data behind a datasource |
Aggregation | A dataprovider that is an aggregation of a column in the datasource |
Datalayer | The exposed objects in the Form scopes that are tied to columns and tables in the database |
Designtime | Designtime refers to everything the developer creates inside Servoy Developer that becomes part of the Solution. These are the Forms, the business logic written, the datalayer definitions etc. |
Runtime | Runtime refers to everything that happens while a Solution is running in a Servoy Client |
SolutionModel | The scripting API that allows developers to modify the design of the Solution at runtime |
ClientDesign | The mode in which a form can be set that allows user to resize and rearrange the Elements on the Form |
Internationalization | The act of and tools for adding multi language and multi timezone support to a Solutions |
i18n | Short for Internationalization |
Smart Client | A native Servoy Client that automatically installs and updated itself on the client machine |
Web Client | A browser based, fully Ajax aware Servoy Client, that executes all it's business logic on the Servoy Application Server, while rendering the UI using just HTML and CSS in a browser |
Headless Client | A Servoy Client that has no UI attached to it and runs on the Application Server and provides a Java API for interacting with all the business logic and forms contained in the Solution it runs |
Batch Processor | A Headless Client that is configured on the Servoy Application Server to automatically start when the Application Server is launched |