Home Page   We Generate Your Software.
Products Services Company Technology Demo Contact Site Map Search
Please note: this document is currently under revision.
The information herein contained, while still valid, does not reflect the latest state of the described technology.
The Somusar/SoProTech[tm] Booklet Series
Volume III

"somusar/Sisendel: A Tutorial Introduction"

Printer friendly


Contents
1. Introduction
2. Sisendel Software Entities
3. Sisendel Basic Types
4. Sisendel User Types
5. Contents of an Entity File
6. Section CORE
7. Section DEFS
8. Section DB
9. Section LOGIC
10. Section UI
11. Implicit Section DOC
12. Section ADJUST
13. Further Reading

Chapter 3 - Sisendel Basic Types

The Sisendel language defines a set of basic types, most of which are similar, or even identical, to the basic types of several computer languages, like C and its derivatives, or Java[tm]: types like bool, or float, or the different integer types are common to the most part, if not all, of those languages.

Some additional basic types of Sisendel derive from types available in database-specific languages, such as SQL: for example, time and unique_id, or similar types, are often used in database tables.

The following table describes all Sisendel basic types. As noted in the table, some field types require additional detailed information in an appropriate section (called DEFS) of the relevant entity file.

Table 1 - Basic types in Sisendel

Type id Description Notes
bool Boolean value -
enum Enumerated value Enumeration values must be defined in section DEFS
float Floating point number Lower and upper bound of validity range may optionally be defined in section DEFS
function Computational object Function parameters and return value(s) must be defined in section DEFS
int8 Signed 8-bit integer number -
int16 Signed 16-bit integer number -
int32 Signed 32-bit integer number -
int64 Signed 64-bit integer number -
range Range of integer values Lower and upper bound of range must be defined in section DEFS
string String of characters Length of string must be specified, may be dynamic
thing Generic object Can be used as a placeholder for complex or multimedia objects, such as documents, sound files, and videoclips (or smell, taste and tactile files in the future).
time Time value -
uint8 Unsigned 8-bit integer number -
uint16 Unsigned 16-bit integer number -
uint32 Unsigned 32-bit integer number -
uint64 Unsigned 64-bit integer number -
unique_id Unique identifier -

Arrays of basic types are defined by specifying their size - possibly dynamic - in square brackets after the field identifier.

Basic types can also be imported from other entities: this feature of Sisendel allows to centralize and share the definition of commonly used simple types, such as identifiers, descriptors and numeric quantities.

The following code example shows several definitions of basic type fields.

Code Example 2 - Use of basic types
File "theater_seat.ef" contains a software representation of a theater seat, defining several fields, but with no collection in sections DB, LOGIC and UI, to keep the example simple. Some notes:
  • Line 12 shows an example of a dynamic array of strings (purchaser);

  • Line 13 shows an example of an imported type definition (customization): library entity "strings.ef" contains a fixed-size string field called description;

  • Lines 16-20 define enumeration symbols and values for field type;

  • Lines 22-23 define input parameters (number) and return value (type) of function cur_type;

  • Lines 25-26 define a validity range for field price;

  • Lines 28-29 define input parameters (type and purchaser) and return value (price) of function cur_price.

Source code - File "theater_seat.ef"
    1      theater_seat "Theater seat"
    2      | Entity representing a theater seat,
    3      | actually an example of usage of built-in types
    4      
    5      unique_id               number                  "Seat number"
    6      bool                    available               "Available"
    7      enum                    type                    "Seat type"
    8      function                cur_type                "Curr. seat type"
    9      float                   price                   "Price range"
   10      | Price range expressed in USD
   11      function                cur_price               "Curr. price"
   12      string                  purchaser[dyn]          "Purchaser"
   13      strings.description     customization           "Customization"
   14      
   15      ----------------------- DEFS
   16      type:
   17         stalls               'S'             "Stalls"
   18         pit                  'P'             "Pit"
   19         box                  'B'             "Box"
   20         gallery              'G'             "Gallery"
   21      
   22      cur_type:
   23         number -> type
   24      
   25      price:
   26         0/7000
   27      
   28      cur_price:
   29         type, purchaser -> price
   30      ----------------------- DB
   31      ----------------------- LOGIC
   32      ----------------------- UI
   33      ----------------------- ADJUST
	       

[Previous chapter]    [Next chapter]    [Back to top]

http:// www.somusar.com  / doc  / booklets  / sisendel_tut  - Powered by SoProMach
Copyright © 2003-2012 Somusar - Trademarks - Legal - Privacy - Webmaster