Table 4-2 Data Service Design Principles
Level
|
Design Principle
|
Description
|
Application Services
|
Base design on client needs
|
Design data services and queries at the Application Services level specifically tuned to client needs, using functions defined at the Logical and Canonical Service levels.
|
Nest or relate information, as required by the application
|
Use the XML practice of nesting related information in a single XML structure. Alternatively, use navigation functions to relate associated information, as required by the application.
|
Introduce constraints at the highest level
|
DSP propagates constraints down function levels when generating queries. By keeping constraints, such as function parameters, at the highest level, you encourage reuse of lower level functions and permit the system to efficiently optimize the final generated query.
|
Aggregate data at the highest level
|
Aggregate data in functions at the highest level possible, preferably at the Application Services level.
|
Logical Services
|
Create common functions to serve multiple applications
|
Design functions that provide common services required by applications. Base function design at the Logical Services level on requirements already established at the Application Services level, based on client needs.
|
Refactor to reduce the number of functions
|
Refactor the functions, as necessary, to reduce the overall number of functions to as few as possible. This reduces complexity, simplifies documentation, and eases future maintenance.
|
Canonical Services
|
Use function defined in the Physical Services level
|
Create (public) read functions can then all be expressed in terms of the main "get all instances" function.
|
Canonical Services
|
Create navigation functions to represent relationships
|
Use separate data services with relationships (implemented through navigation functions) rather than nesting data. For example, create navigation functions to relate customers and orders or customers and addresses instead of nesting this information.
This keeps data services and their queries small, making them more manageable, maintainable, and reusable.
|
Define keys to improve performance
|
Defining keys enables the system to use this information when optimizing queries.
|
Establish relationships between unique identifiers and primary keys
|
Establish relationships between unique identifiers or primary keys that refer to the same data (such as Customer ID or SSN) but vary across multiple data sources. You can use either of the following methods:
|
Physical Services
|
Employ functions that get all records
|
Using private functions that get all records at the Physical Services level provides the system with the most flexibility to optimize data access based on constraints specified in higher level functions.
|
Do not perform data type transformations
|
The system is unable to generate optimizations based on constraints specified at higher levels when data type transformations are performed at the Physical Services level.
|
Do not aggregate
|
Use aggregates at the highest level possible to enable the system to optimize data access.
|