Kbase P53911: Dynamics. Dynamic SBOs
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  11/13/2003 |
|
Status: Unverified
GOAL:
Dynamics. Dynamic SBOs
FACT(s) (Environment):
Dynamics 2.1A
FIX:
Dynamic SBOs
This section discusses the new dynamic Progress SmartBusinessObject· (SBO).
Overview
As a container of related Progress SmartDataObjects· (SDOs), the SmartBusinessObject (SBO) manages a set of SDOs as a single database transaction and provides a place to express business logic that has access to the data of the entire transaction. In addition, the SBO provides optimized fetch and commit methods for the entire dataset across an Progress AppServer· connection using a single request. The SBO is the primary object in ADM and Progress Dynamics applications providing transaction control over multiple table updates.
In this release, Progress Dynamics introduces the Dynamic SBO. You can create a Dynamic SBO in the Container Builder using both static and dynamic SDOs as data sources. For Progress Dynamics Version 2.0A02, Dynamic SBOs are only supported for GUI clients. Dynamics SBOs are not supported for DHTML clients in this release.
NOTE: While a dynamic SDO can act as a data source for a static SBO, the dynamic SDO cannot be contained in a static SBO.
The new class DynSBO (a subclass of SBO) implements the dynamic SBO. The dynamic SBO moves the procedures and functions of a static SBO into the class super procedure. Like the dynamic SDO, the dynamic SBO supports a data logic procedure. The data logic procedure provides a place for your custom business logic, including hooks for validation code.
NOTE: In this release, the static SBO has also been enhanced to support data logic procedures.
Container Builder Support
The new dynamic SBO is a dynamic container, and is therefore created in the Container Builder.
The Container Builder also supports:
· Specifying data links between contained SDOs.
· Specifying the SBO as a data source for a visual object.
· Generating an optional data logic procedure.
· Editing a data logic procedure.
NOTE: If a visual object is an update source of an SBO, the UpdateTargetNames property of the visual object must be set to a comma-delimited list of all the SDO names contained in the SBO that will be affected by an Update operation.
Viewers
The AppBuilder allows use of both static and dynamic SBOs when you select fields for dynamic viewers. The AppBuilder will create DataField instances for the viewer when it is saved.
DataField names for SBOs include the name of the SDO that is the data source for the field and use this format:
<SdoInstanceName>.<FieldName>
As an exception, and to promote reuse, if a viewer only contains SBO DataFields from a single SDO, then the SDO name does not need to prefix the field names.
Data Logic Procedure
This release contains a new template for data logic procedures that support SBOs. Use the AppBuilder·s New dialog box to access the template. The only architectural difference between static SBO and dynamic SBO data logic procedures is that static SBOs support custom logic hooks either directly in the object (<SboName>.w) or in a data logic procedure, but not both.
Dynamic SBOs can only support custom logic in their data logic procedure. Only the major four custom hooks are supported in the SBO data logic procedure: Pre/Begin/End/Post TransactionValidate.
Like the SDO, the dynamic SBO data logic procedure contains static definitions of all SDO temp tables. This feature allows you to express custom business logic in static 4GL code.
The DataLogicProcedure attribute is now part of the SBO and DynSBO classes.
Data logic procedure for static SmartBusinessObjects · Static SmartBusinessObjects (SBOs) now have a property sheet that you can use to add a data logic procedure to an SBO or remove data logic procedure from and SBO.
API
The SBO supports the standard hooks for custom code structured around a commit operation.
The SBO also helps coordinate the execution of custom code hooks for the contained SDOs.
A new ADM2 object, dynsbo.w, represents run-time instances of DynSBOs.
The dynamic SBO .supports the API used for static SBOs. In addition, the SBO supports the following new SBO Properties:
· LastCommitErrorType · This current SDO property is now included in both static and dynamic SBOs. It contains a semicolon-delimited list of the corresponding SDO property values.
· LastCommitErrorKeys · This SDO property is now included in both static and dynamic SBOs. For SDOs, it is a comma-delimited list of the key values of the records that failed to commit. The KeyFields property of the SDO holds the key field names. For SBOs, the property will hold a semicolon-delimited list of corresponding SDO property value.
The API contains the following new SBO methods:
· UpdateData · This is the SBO version of an existing SDO function. The parameters are identical. The SBO version adds support for column names that are qualified by the appropriate SDO name.
· DeleteData · This is the SBO version of an existing SDO function. The parameters are identical. The SBO version adds support for column names that are qualified by the appropriate SDO name.
· CreateData · This is the SBO version of an existing SDO function. The parameters are identical. The SBO version adds support for column names that are qualified by the appropriate SDO name..