Presentation is loading. Please wait.

Presentation is loading. Please wait.

$PH/COOL-GEN/TTTA_metadata_jk_rl.ppt 99s523 CHGEN project - Spinney/Karner; revised 06f522 - RJL 1 Metaschema options (in chgen v14 TBD?) Slides 2 and.

Similar presentations


Presentation on theme: "$PH/COOL-GEN/TTTA_metadata_jk_rl.ppt 99s523 CHGEN project - Spinney/Karner; revised 06f522 - RJL 1 Metaschema options (in chgen v14 TBD?) Slides 2 and."— Presentation transcript:

1 $PH/COOL-GEN/TTTA_metadata_jk_rl.ppt 99s523 CHGEN project - Spinney/Karner; revised 06f522 - RJL 1 Metaschema options (in chgen v14 TBD?) Slides 2 and 3 are taken from TTTA_metadata_jk.ppt. –(Karner and Spinney’s 99s523 chgen v11 project file) Slide 2 diagrams chgen’s internal hcg_-structures and slide 3 defines a new internal representation of metadata which was implemented in chgenv11. Slide 4 identifies the limitations of that tree-structured model. The next two slides (5,6) explain how boot-strapping chgen can support the same flexible metadata model that is available for the application data schema. This major revision (061108) adds 4 slides with 3 sample extensions: (1) metaschemaCK - adds CandidateKey (CK) and CKtoTAassociation (CA) tables. (2) metaschemaNS – 2A: Add tables NameSpace NS, ProjectVersion PV and PS association; 2B: add table VT and split table TS.

2 $PH/COOL-GEN/TTTA_metadata_jk_rl.ppt 99s523 CHGEN project - Spinney/Karner; revised 06f522 - RJL 2 hcg_ts_list hcg_table_seqlist ( 1 ) - ttabrev - rcount - maxver hcg_view_list ( 3 ) - numviews view_element_type (4) - view name - mode version_elt_type ( 5 ) - version no. ts_list (container) ts_type ( 2 ) - maxrows - vrcount 1:HCGNumTables 1 : MAXVersions 1 : MAXViews 1 : HCGNumTables Current hcg table Hierarchy

3 $PH/COOL-GEN/TTTA_metadata_jk_rl.ppt 99s523 CHGEN project - Spinney/Karner; revised 06f522 - RJL 3 (see also $PH/COOL-GEN/ hcg_struct_migrationR1.ppt) SV Type( 3 ) - Schema Name - Schema Version - numTables - struct tt_type *tt_ptr[HCG_NUMTABLES] - strict vv_type * vv_ptr[MAXViews] ta type - FieldName[ NAMELENGTH ] -AltFieldName[ NAMELENGTH ] - FieldType[ NAMELENGTH ] - comment[ MAXCOMMENTLENGTH ] - IsKey - HasBp - Singleton - struct ta_type *next_ptr vv type( 4 & 5 ) - viewName[ MAXVIEWNAMELEN] - mode - versionNo[ HCG_NUM_TABLES ] - numTables ts type( 2 ) - versionNo - maxrow - vrcount tt type( 1 ) - ttabbr[ABBRNAMELENGTH] - tableName[NAMELENGTH] - comment[ MAXCOMMENTLENGTH ] - maxver - rcount struct ta_type *ta_ptr[NUMATTRIBUTES] struct ts_type *ts_ptr[ MAXVERSIONS ] struct tt_type *next_ptr 1 : HCG_NUMTABLES 1 : MAXVERSIONS 1 : MAXVIEWS 1 : NUMATTRIBUTES Proposed tt  sv  vv Hierarchy for CHGEN MetaData

4 $PH/COOL-GEN/TTTA_metadata_jk_rl.ppt 99s523 CHGEN project - Spinney/Karner; revised 06f522 - RJL 4 99s523 genv10 Model Limitations The proposed data model (previous slide) does not include symmetric binary relations which a bootstrapped chgen process can handle. The preferred data model is metaschema.sch with tables SV, TT, TA, VV, TS. Table TS is a binary association between TT and VV. Table TS includes both TTid and VVid fkeys, as shown below. The version number content of table VV is deprecated. Table VV should merely associate an arbitrary subset of TT_rows with each Viewname and declare its access mode in that view. Views are important e.g. to permit input and output test data formats or database conversion formats to be pre-defined in separate views in the schema). SV TT TA VV TS SV = SchemaVersion TT = TableType TA = TableAttribute VV = ViewVersion TA = TableStats

5 $PH/COOL-GEN/TTTA_metadata_jk_rl.ppt 99s523 CHGEN project - Spinney/Karner; revised 06f522 - RJL 5 Chgen Boot-strap Iterations A bootstrapped version of chgen can load.msdat tables SV, TT, TA, VV, and TS from the metaschema.msdat file created earlier by chgen – metafile. Access to the meta-schema tables SV, TT, TA, VV, and TS is supported by pr_*.c code that is also automatically generated by that prior chgen run. Later versions of chgen may add more new tables to the same or a new metaschema.sch file version (SV_row), and may define more views which contain subsets of these tables in file metaschema.viewdefs; pr_init now adds each view spec (list of [versioned] table types) to table VV and TS. Later versions will remove the versionNo component of pfkeys and add a a new NameSpace (NS) table.

6 $PH/COOL-GEN/TTTA_metadata_jk_rl.ppt 99s523 CHGEN project - Spinney/Karner; revised 06f522 - RJL 6 Chgen Boot-strap Example 1 Example 1: (slides 6 - 8) Metadata to support queries, This example adds tables CK and CK below TT and TA. Based on composite-keys. CK = CandidateKey, CA = CKtoTAassociation add candidate key specification metadata input tables and methods to maintain uniqueness of DB content wrt. any candidate key. adding application data model tables and methods to support regression testing by declaring test data input and output formats. Both of these may add new viewnames to metaschema table VV by augmenting file application.viewdefs.

7 $PH/COOL-GEN/TTTA_metadata_jk_rl.ppt 99s523 CHGEN project - Spinney/Karner; revised 06f522 - RJL 7 Example 1a: MetaschemaCK with CandidateKeys: (this is the subject of 06f522 asgnt3) SV TT TA VV TS SV = SchemaVersion TT = TableType TA = TableAttribute VV = ViewVersion TA = TableStats CK = CandidateKey CA = CKtoTAassociation CK CA (2 new table types)

8 $PH/COOL-GEN/TTTA_metadata_jk_rl.ppt 99s523 CHGEN project - Spinney/Karner; revised 06f522 - RJL 8 Example 1b: MetaschemaCK with CandidateKeys and non-key attributes*: _SV___ svname sformat sversion lastMod svpath descr _TT_______ ttabb c5 ttnamec30 _TA__________ fname ?? dfltval ???? c32 ftype i4 c10 Iskey 0 c4 comment // t132 _VV______ vname mode (r/w/a) num_tables _TS___ verno ** maxrow vvrcount SV = SchemaVersion TT = TableType TA = TableAttribute VV = ViewVersion TA = TableStats New table types: CK = CandidateKey CA = CKtoTAassociation NS = NameSpace _CK________ CKname c32 CArcount i2 _CA______ CAorder i2 *(A primary surrogate key attribuyte XXid is implied by the table abbrev XX. A foreign key attribute YYid is implied by any link incoming from an aggregate parent or superclass table with ttabbrev YY.) ** verno is a deprecated component of pfkeys. It will be removed along with verno in TS. A NS tag component will be prefixed to pfkeys instead.

9 $PH/COOL-GEN/TTTA_metadata_jk_rl.ppt 99s523 CHGEN project - Spinney/Karner; revised 06f522 - RJL 9 Chgen Boot-strap Example 2: Example 2: (slides 9-12): Add NameSpace and ProjectVersion tables; simplify table TS and add table VT. This example adds new tables lateral to root table SV, that do not affect existing table formats or generated code. It adds NameSpace NS and ProjectVersion PV; also adds PVtoSV associative entity PS. SV must be known to PV to insure consistency of database declarations in generated code and database references in application code. The goal is to evolve and reuse system packages like GEN, LCP, BDE independently of each other. NameSpace instances partition the data model entities into separate NameSpace scopes to avoid ttabb conflicts. NameSpace partitions permit reuse of the same ttabb in a different namespace; TBD Challenge: Use NameSpaces to promote higher-level encapsulation for inter-NS access than for intra-NS access. Example 2 also modifies leaf table TS (split into TS and VT).

10 $PH/COOL-GEN/TTTA_metadata_jk_rl.ppt 99s523 CHGEN project - Spinney/Karner; revised 06f522 - RJL 10 Example 2a: MetaschemaNS with NameSpace table _SV___ svname sformat sversion lastMod svpath descr _TT_______ ttabb c5 ttnamec30 descr t80 _TA__________ fname ?? dfltval ???? c32 ftype i4 c10 Iskey 0 c4 comment // t132 _VV______ vname mode (r/w/a) num_tables _TS [2] verno maxrow vvrcount SV = SchemaVersion TT = TableType TA = TableAttribute VV = ViewVersion TS = TableStats New table types: NS = NameSpace (TBD) Eliminated table types: CK = CandidateKey CA = CKtoTAassociation _NS (TBD) [1] nsabb nsname descr 1. An NS row# is encoded into a new NSidx component of each pfkey. 2. Table TS will be split into VT and TS on the next slide. 0..1

11 $PH/COOL-GEN/TTTA_metadata_jk_rl.ppt 99s523 CHGEN project - Spinney/Karner; revised 06f522 - RJL 11 Example 2b: MetaschemaNS and Project associations _SV___ svname sformat sversion lastMod svpath descr _TT_______ ttabb c5 ttnamec30 descr t80 _VV______ vname mode (r/w/a) num_tables SV = SchemaVersion TT = TableType TA = TableAttribute VV = ViewVersion TA = TableStats New table types: NS = NameSpace (TBD) PV = ProjectVersion (TBD) PS = PVtoSVassociation(TBD) _NS (TBD)___ nsabb nsname descr PV (TBD) PVname PVpath ???... _TA___ … _PS (TBD) 0..1 _TS _____ verno maxrow vvrcount

12 $PH/COOL-GEN/TTTA_metadata_jk_rl.ppt 99s523 CHGEN project - Spinney/Karner; revised 06f522 - RJL 12 Example 2c: MetaschemaNS with TS changes (TS+VT) _SV___ svname sformat sversion lastMod svpath descr _TT_______ ttabb c5 ttnamec30 descr t80 _VV______ vname mode (r/w/a) num_tables _TS [2]___ maxrow vvrcount** SV = SchemaVersion TT = TableType TA = TableAttribute VV = ViewVersion TA = TableStats New table types: NS = NameSpace (TBD) PV = ProjectVersion (TBD) PS = PVtoSVassociation(TBD) VT = VVtoTTassociation (from TS) _NS (TBD)___ NSname descr PV (TBD) PVname PVpath ???... _TA___ … _PS (TBD) _VT [1] ______ //table-in-view verno 1. VT defines a VV to TT association (split out from TS). (Should mode become table- as well as view-specific?) 2. TS fields maxrow and rcount now apply to the entire ttabb table. Since it is no longer view-specific, table TS could be merged into TT. WARNING: TS is not constant. 0..1


Download ppt "$PH/COOL-GEN/TTTA_metadata_jk_rl.ppt 99s523 CHGEN project - Spinney/Karner; revised 06f522 - RJL 1 Metaschema options (in chgen v14 TBD?) Slides 2 and."

Similar presentations


Ads by Google