Persistate

Writing definition files

Hide Navigation Pane

Writing definition files

Previous topic Next topic No directory for this topic  

Writing definition files

Previous topic Next topic Topic directory requires JavaScript JavaScript is required for the print function Mail us feedback on this topic!  

The definition file is the starting point for all Persistate applications, which are generally called packages.  For a complete example of a definition file see An Example Definition File.  This has links showing popups giving a short explanation of many of the language keywords.  In a definition file, you describe the following aspects of your package.

The set of imported packages you want to use in your own package, including at least the Persistate package.  See Package Import Definition for full details.  Here is an example.

Use Persistate.

Zero or more data classes.  Each of these defines the set of values that an individual datum can take.  See Data Class Definition for full details.  Here are some examples.

An ISBN number takes text values of length typically 20 maximum 25.
A maximum lend count takes values from 1 to 6.
A lend status takes values available, on loan, unavailable.

One or more object classes.  These are similar to object oriented classes, and define a set of members that instances of the class will have.  Your set of object classes defines the structure of the persistent object tree used by your package.  See Object Class Definition for full details. Here is an example.

Each publication in the library is a stable persistent containing
   a nominative title,
   a distinctive ISBN number,
   several stock copies
.

Zero or more operation groups each containing one or more operations.  These define the basic units of processing performed by your package.  See Operation and Operation Group Definition for full details. Here is an example.

operation group action containing {
   the operation receive books with menu and toolbar visibility,
   the operation new borrower with menu and toolbar visibility,
   the operation create test data with menu and toolbar visibility,
   the operation blacklist author with menu and toolbar visibility
}

Zero or more view classes.  These are analogous to database queries, but work on the persistent tree defined by your object classes, providing a view which can include members from more than one class.  See View Class Definition for full details. Here is an example.

Every monthly lend statistic in the library consolidated by
   its lends publication if book genre
contains
   the genre name in first order,
   a lend count = count of its lends
where 
   its lends borrowed > parameter from and
      (its lends borrowed < parameter to
      or its lends returned < '12/12/2007')
.

Zero or more workspaces.  These define an arrangement of panes in your user interface.  See Workspace Definition for full details. Here is an example.

Workspace public library size 800 by 600 contains
   a 50 pixel fixed top controls pane for control layouts,
   a central main pane containing {
      a 20% left navigation pane for tree layouts,
      a splittable right content pane
   },
   a 25 pixel fixed bottom status bar pane for control layouts
.

Zero or more class categories.  These define sets of functionalities which influence the behaviour of object classes defined with the category.  Persistate defines a number of class categories for you and you will rarely have to define any yourself.  See Class Category Definition for full details. Here is an example.

Logged configurative classes have functions
   use cache,
   save in configuration,
   clone on mutate,
   log associations
.