Describes why the set of options makes AnyDAC a flexible database framework and how to use the options. AnyDAC offers the wide range of the options organized into an hierarchical options system. Most of the options may be leaved with their default values.
The AnyDAC options are organized into five groups:
Because AnyDAC introduces a lot of options, setting up each dataset or command may do the programming complex and error prone. AnyDAC solves this issue by introducing a parent-child option values inheritance model. The option values are propagated from a parent to a child (top-down). If a lower level has no option value assigned explicitly, a value will be taken from a higher level, where a value is assigned or from the top-most level. The AnyDAC has levels:
A Manager is the top-most level, a Connection is the intermediate and a Command / Dataset is the bottom level. So, by setting any particular Manager or Connection option, all Datasets will inherit its value. This is true as long as a programmer has not explicitly assigned a value to the Dataset option.
The TxxxOptions.AssignedValues flags controls the inheritance. If some option is changed at this level, then corresponding flag is included into AssignedValues. If flag is not included, then an option value is inherited from the more high level. Excluding flag from AssignedValues makes option inheriting its value from the more high level again.
The mapping of data types from the DBMS types to the client types defined in FormatOptions is inherited by all Commands from their Connection.
with oConnection.Options.FormatOptions do begin OwnMapRules := True; MapRules.Clear; with MapRules.Add do begin PrecMax := 19; PrecMin := 4; SourceDataType := dtFmtBCD; TargetDataType := dtCurrency; end; end;
A Data Warehouse application may setup high-speed fetching mode, using FetchOptions of the Manager level. So, all connection and all their commands will inherit these options.
with ADManager.FetchOptions do begin Items := ; Cache := ; RowsetSize := 1000; end;
What do you think about this topic? Send feedback!