Persistate

An Example Definition File

Hide Navigation Pane

An Example Definition File

Previous topic Next topic No directory for this topic  

An Example Definition File

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

The following is an example of a Persistate definition file.  It describes a simple lending library application.  Click the red links in this example to pop up a short explanation of the feature.

// Definition file for the library sample Persistate application

// Import other application definitions
Use Persistate.

// Define data classes for the library
A name takes values of length typically 25 maximum 100.
A title takes text values of length typically 25 maximum 100.
An ISBN number takes text values of length typically 20 maximum 25.
A copy number takes integer values.
A postcode takes text values of length typically 10 maximum 15.
A telephone number takes text values of length typically 15 maximum 25.
An email address takes text values of length typically 25 maximum 60.
A maximum lend count takes values from 1 to 6.
A lend status takes values available, on loan, unavailable.
A date takes datetime values.

// Define object classes for the library
The library is a configurative persistent containing
   a distinctive nominative name = """The Library""",
   many authors,
   many diverse publications,
   many borrowers,
   many distributed lends,
   several genres,
   selected monthly lend statistics,
   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
   }
.

Each person is a stable persistent containing
   a nominative forename name,
   a nominative surname name,
   a full_ name = "surname + "", "" + forename"
.

Each author in the library is a stable person containing
   a publisher text,
   several associated books from the library publications
.

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

Each periodical is a stable publication containing
   an issue number integer,
   a discriminative issue_ date
.

Each book is a stable publication containing
   a discriminative associated author from the library authors,
   an associated genre from the library genres
.

Each genre is a configurative persistent containing
   a distinctive nominative name
.

Each stock copy of a publication is an orderable persistent containing
   a discriminative name = "ParentPublication.Title + "" ("" + Order + "")""",
   a lend status,
   an associated lend from the library lends,
   operation group stock copy containing {
      the operation withdraw copy with context visibility
   }
.

Each borrower in the library is a stable person containing
   a discriminative postal address,
   a telephone number,
   a home_ email address,
   a business_ email address,
   a maximum lend count,
   several associated lent_ stock copies,
   selected overdue counts,
   operation group borrower containing {
      the operation borrow books with menu and context visibility,
      the operation return books with menu and context visibility
   }
.

Each lend in the library is a transitory persistent containing
   a discriminative associated publication from the library publications,
   an associated stock copy from its publication stock copies,
   a discriminative associated borrower from the library borrowers,
   a borrowed datetime,
   a due datetime,
   a returned datetime,
   a lend month text = "MonthOf(Borrowed)"
.

Each postal address of a borrower is a stable persistent containing
   a discriminative street text,
   a discriminative city name,
   a province name,
   a postcode, 
   a country name
.

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
.

Every overdue count in a borrower contains
   a count = count of its lent stock copies
where
   its lent stock copies lend status = on loan
   and its lent stock copies lend due < parameter now
.

Workspace public library size 800 by 600 contains
   a 48 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 24 pixel fixed bottom status bar pane for control layouts
.