Loading ...
Loading ...
Loading ...
T24 Application Development
Step 5 – Creating the Data Access Service
Introduction
All queries (i.e. SELECT operations) that are performed against a table are consolidated into a Data
Access Service (DAS) for the application. This centralises all query processing for a given table in one
place and removes any query language from the code. Each query is expressed in a simple meta-
query language (as per ENQUIRY) that defines the fields, operands, data and joins between criteria
(AND / OR).
When executed, the meta-query language generates the specific query language depending on the
target database (JQL, SQL, xQuery, etc.)
This approach allows control on the DAS routines and prevents poor queries being defined. Each
query in the DAS is named and has a description, and the DAS itself allows discovery of the queries
that are supported. There is also a facility to cache the results of static data.
The name of the DAS is DAS.MYAPPLICATION, where MYAPPLICATION is the name of the
application, e.g. DAS.EB.LOOKUP
Defining the Queries
Each query definition has two parts – the name of the query and a description of the query.
The name of the query is a simple numeric equate and is stored in I_DAS.MYAPPLICATION:
EQU dasExamplesInterestSchedules TO 1
EQU dasExamplesTodaysSchedules TO 2
EQU dasExamplesDealsOfAType TO 3
EQU dasExamplesCustomerCurrency TO 4
Each query name must be equated to a unique integer, as this is the pointer used in the caching
mechanism. The name of the query must be prefixed with DAS.MYAPPLICATION$, and then followed
by a meaningful name.
The description of the query is held in I_DAS.MYAPPLICATION.NOTES, which should be created
from the template I_DAS.TEMPLATE.NOTES as it must contain a dimensioned array for the cache
and the notes.
COMMON/DAS.EXAMPLES/DAS$CACHE(100),DAS$NOTES(100)
*-----------------------------------------------------------------------------
DAS$NOTES(dasExamplesInterestSchedules) = 'All interest Schedules'
DAS$NOTES(dasExamplesTodaysSchedules) = 'All schedules with today’s date'
DAS$NOTES(dasExamplesDealsOfAType) = 'All deals with the supplied DEAL.TYPE'
DAS$NOTES(dasExamplesCustomerCurrency) = 'Deal that have the supplied customer AND
supplied currency'
TEMENOS T24 User Guide Page 22 of 34
Loading ...
Loading ...
Loading ...