The Singleton Pattern
Within the EARP application, we need to store information that is shared across the system for all the users. These values are unique in the application, and when changed they are valid immediately for everyone inside a company. They can be held in memory, and are only acquired from the database when changed. For this requirement, we can implement the Singleton Pattern.
Technical description
The Singleton pattern contains a table object with a specific primary key structure that is enforced by the system, allowing the table object to contain only one record. Users cannot add or remove records. When a new company is created, a record in each Singleton table is created automatically, although this is optional.
To enforce the existence of a record when it is required, each Page object that is based on the table should contain business logic to create the record, in case it does not exist yet. The reasons for the record to be missing can be that the table...