CWM: Model Driven Architecture Dr. Daniel T. Chang IBM DBTI for e-business (dtchang@us.ibm.com)
Abstract CWM is a new metadata standard for data warehousing and business intelligence, which was adopted by the OMG in April, 2001 and which is gaining wide support in the industry. CWM s strength is in its model driven architecture (MDA) that is based on and utilizes UML, MOF and XMI. This talk will discuss the major perspectives and essential components of the CWM MDA. It will elaborate on a number of important innovations introduced by CWM that improved the CWM MDA s modularity, reuse, and automatic generation capability. Daniel T. Chang (Copyright 2001) 2
CWM Daniel T. Chang (Copyright 2001) 3
CWM 1.0 A complete specification of the syntax and semantics needed to export/import shared metadata for data warehousing (DW) and business intelligence (BI), including: The CWM Metamodel (ad/2001-02-01) Formal representation of the CWM Metamodel (CWM XML, ad/2001-02-03) Interchange format for shared DW/BI metadata (CWM DTD, ad/2001-02-04) Access API for shared DW/BI metadata (CWM IDL, ad/2001-02-06) Daniel T. Chang (Copyright 2001) 4
The CWM Metamodel Management Warehouse Process Warehouse Operation Analysis Transformation OLAP Data Mining Information Visualization Business Nomenclature Resource Object Relational Record Multi Dimensional XML Foundation Business Information Data Types Expressions Keys Index Type Mapping Software Deployment Object Model Core Behavioral Relationships Instance Daniel T. Chang (Copyright 2001) 5
CWM Design Basis OMG Metamodel Architecture UML/MOF Model as the standard language for defining metamodels XMI as the standard mechanism for interchanging metadata in XML MOF to IDL Mapping as the standard mechanism for accessing metadata through APIs (independent of programming languages) MOF to Java Mapping (JMI)* as the standard mechanism for accessing metadata through Java * Coming soon Daniel T. Chang (Copyright 2001) 6
CWM Model Driven Architecture CWM Specification CWM XML MOF DTD CWM Metamodel (in UML Notation) CWM DTD CWM Metadata Interchange (in XML) CWM IDL/ CWM Java* CWM Metadata Access Daniel T. Chang (Copyright 2001) 7
CWM MDA: Perspectives Daniel T. Chang (Copyright 2001) 8
MDA Terminology Model A formal specification of the function, structure and/or behavior of a system. Platform-independent model A model that abstracts away technological and engineering details. Platform-specific model A model that contains technological and engineering details. Daniel T. Chang (Copyright 2001) 9
Metamodeling Perspective Data (M0) User Data/Object Layer <Stock name= IBM price= 112 /> Metadata (M1) Metadata/Model Layer Stock: name, price Metametadata (M2) Metamodel Layer UML: Class, Attribute CWM: Class, Attribute Table, Column ElementType, Attribute Meta-metametadata (M3) Meta-metamodel Layer MOF: (Meta)Class, (Meta)Attribute, (Meta)Association Daniel T. Chang (Copyright 2001) 10
Meta Objects Perspective Data/Objects, Tools/Applications Metadata/Models, Tools/Applications Metamodels (UML, CWM, ) Meta Object Facility (MOF Model, MOF-IDL, XMI) Daniel T. Chang (Copyright 2001) 11
Technology Platform Perspective Platform Independent Platform Dependent CWM Specification CWM XML MOF DTD CWM Metamodel (in UML Notation) CWM DTD CWM Metadata Interchange (in XML) CWM IDL/ CWM Java* CWM Metadata Access Daniel T. Chang (Copyright 2001) 12
Product Platform Perspective Platform Independent Platform Dependent CWM Specification CWMX Specification CWM Metamodel (in UML Notation) CWMX Metamodel (in UML Notation) Record OLAP DMSII, IMS Essbase, Express Daniel T. Chang (Copyright 2001) 13
CWM MDA: Components Daniel T. Chang (Copyright 2001) 14
UML The metamodeling language UML Notation, OCL Source for the CWM base/object metamodel (CWM ObjectModel package) Subset of UML Foundation, Common_Behavior, and Model_Management packages Daniel T. Chang (Copyright 2001) 15
Rational Rose The metamodeling tool Class diagram: metamodel Class, attribute; association; package Collaboration diagram: metadata Object, object link CWM MDL Daniel T. Chang (Copyright 2001) 16
Rational Rose: CWM/Relational /constraint CheckConstraint deferrability : DeferrabilityType * * /constrant ColumnSet 0..1 /feature /owner * {ordered} /constrainedelement Column {ordered} precision : Integer scale : Integer isnullable : NullableType length : Integer collationname : String charactersetname : String / optionscopecolumnset : NamedColumnSet / referencedtabletype : SQLStructuredType * * /structuralfeature /type 1 SQLDataType typenumber : Integer NamedColumnSet / optionscopecolumn : Column / type : SQLStructuredType / usingtrigger : Trigger QueryColumnSet query : QueryExpression SQLDistinctType length : Integer precision : Integer scale : Integer / sqlsimpletype : SQLSimpleType * {ordered} /constrainedelement Table istemporary : Boolean temporaryscope : String / trigger : Trigger issystem : Boolean View isreadonly : Boolean checkoption : Boolean queryexpression : QueryExpression sqldistincttype * SQLSimpleType charactermaximumlength : Integer characteroctetlength : Integer numericprecision : Integer numericprecisionradix : Integer numericscale : Integer datetimeprecision : Integer Daniel T. Chang (Copyright 2001) 17 1 sqlsimpletype
Rational Rose: CWM/Relational Example 1: CREATE TYPE Person_t AS (name varchar(20), birthyear integer) CREATE TYPE Emp_t UNDER person_t AS (salary integer) Person_t : SQLStructuredType name : Column varchar : SQLSimpleType parent : Generalization birthyear : Column child Emp_t : SQLStructuredType integer : SQLSimpleType salary : Column Daniel T. Chang (Copyright 2001) 18
MOF The metamodeling language MOF Model APIs for metadata access: Generic: MOF Reflective Metamodel specific: MOF to IDL Mapping CWM MOF Daniel T. Chang (Copyright 2001) 19
MOF-IDL: CWM Relational.idl interface Table :TableClass, NamedColumnSet { boolean is_temporary () raises (Reflective::MofError); void set_is_temporary (in boolean new_value) raises (Reflective::MofError); string temporary_scope () raises (Reflective::NotSet, Reflective::MofError); void set_temporary_scope (in string new_value) raises (Reflective::MofError); void unset_temporary_scope () raises (Reflective::MofError); boolean is_system () raises (Reflective::MofError); void set_is_system (in boolean new_value) raises (Reflective::MofError); }; // end of interface Table Daniel T. Chang (Copyright 2001) 20
XMI The metadata interchange mechanism XML DTD Production MOF-compliant metamodel => XML DTD (e.g, CWM DTD) XML Document Production MOF-compliant model => XML document (e.g., CWM XML) Daniel T. Chang (Copyright 2001) 21
XMI: CWM XML (MOF DTD) <Model:Class xmi.id='a490' name='table' annotation='' isroot='false' isleaf='false' isabstract='false' visibility='public_vis issingleton='false' supertypes='a480'> <Model:Namespace.contents> <Model:Attribute xmi.id='a491' name='istemporary' annotation='' scope='instance_level' visibility='public_vis ischangeable='true' isderived='false' type='a25'> <Model:StructuralFeature.multiplicity> <XMI.field>1</XMI.field> <!-- lower --> <XMI.field>1</XMI.field> <!-- upper --> <XMI.field>false</XMI.field> <!-- is_ordered --> <XMI.field>false</XMI.field> <!-- is_unique --> </Model:StructuralFeature.multiplicity> </Model:Attribute> </Model:Namespace.contents> </Model:Class> Daniel T. Chang (Copyright 2001) 22
XMI: CWM DTD <!-- ========= CWMRDB:Table ========= --> <!ELEMENT CWMRDB:Table.isTemporary EMPTY> <!ATTLIST CWMRDB:Table.isTemporary xmi.value (true false) #REQUIRED> <!ELEMENT CWMRDB:Table.temporaryScope (#PCDATA XMI.reference)*> <!ELEMENT CWMRDB:Table.trigger (CWMRDB:Trigger)*> <!ELEMENT CWMRDB:Table.isSystem EMPTY> <!ATTLIST CWMRDB:Table.isSystem xmi.value (true false) #REQUIRED> <!ENTITY % CWMRDB:TableFeatures CWMRDB:Table.isSystem'> <!ENTITY % CWMRDB:TableAtts issystem (true false) #IMPLIED'> <!ELEMENT CWMRDB:Table (%CWMRDB:TableFeatures;)*> <!ATTLIST CWMRDB:Table %CWMRDB:TableAtts;> Daniel T. Chang (Copyright 2001) 23
IBM_Relational.xml <CWMRDB:Catalog xmi.id="_1" name="cwmstore"> <CWM:Namespace.ownedElement> <CWMRDB:Schema xmi.id="_1.1" name="guest" namespace="_1"> <CWM:Namespace.ownedElement> <CWMRDB:Table xmi.id="_1.1.1" name="period" namespace="_1.1"> <CWM:Classifier.feature> <CWMRDB:Column xmi.id="_1.1.1.1" name="period_id" length="10" type="_11" owner="_1.1.1"/> </CWM:Classifier.feature> </CWMRDB:Table> </CWMRDB:Catalog> <CWMRDB:SQLSimpleType xmi.id="_11" name="integer typenumber="4"/> Daniel T. Chang (Copyright 2001) 24
CWM MDA: Innovations Daniel T. Chang (Copyright 2001) 25
CWM Packaging Structure Improves ease of comprehension Improves ease of utilization See CWM MDL (ad/2001-02-07) CWM ObjectModel Foundation Resource Relational Record Analysis Management Daniel T. Chang (Copyright 2001) 26
CWM ObjectModel Reuse of UML: profile/subset for DW/BI ObjectModel (from CWM) <<metamodel>> Core <<metamodel>> Behavioral <<metamodel>> Relationships <<metamodel>> Instance Daniel T. Chang (Copyright 2001) 27
CWM ObjectModel Reuse as common superclasses for other resource packages Resource Intent Extent Object Package Class Attribute Extent Object Data Value Relational Catalog/ Schema Table Column RowSet Row Column Value Record RecordFile RecordDef Field RecordSet Record Field Value Multidimensional Schema Dimension Dimensioned Object MemberSet Member Member Value XML Schema ElementType Attribute Document Element Data Value Daniel T. Chang (Copyright 2001) 28
CWM/CWMX Interchange and access of shared metadata at three abstraction levels ObjectModel/ UML Object:Class, Attribute CWM Relational:Table, Column XML:ElementType, Attribute... CWMX ER: Entity, Attribute Your own... Daniel T. Chang (Copyright 2001) 29
Rose Profile for MOF Enables automatic generation starting from the Rational Rose modeling tool Rose to MOF mapping: Package (<<metamodel>>) Class Attribute, <<reference>> Association, Role (=> AssociationEnd) MOF Tab Properties See CWM MDL. Daniel T. Chang (Copyright 2001) 30
CWM MDA: What is needed? Daniel T. Chang (Copyright 2001) 31
Strict Alignment of MOF and UML MOF Model and UML as a Metamodeling Language Metamodeling constructs E.g., Reference Specification format Data types E.g., Expression Daniel T. Chang (Copyright 2001) 32
MOF Profiling Mechanism/Tool MOF-compliant metamodel => subset with/without renaming E.g., UML => CWM ObjectModel ObjectModel (from CWM) <<metamodel>> Core <<metamodel>> Behavioral <<metamodel>> Relationships <<metamodel>> Instance Daniel T. Chang (Copyright 2001) 33
OCL Processor OCL validation: syntax, semantics TransformationStep / task : TransformationTask / activity : Namespace / precedence : Constraint / precedingstep : Dependency / succeedingstep : Dependency 1..* * 1..* * StepPrecedence / precedingstep : ModelElement / succeedingstep : ModelElem... [C-1] The preceding step and succeeding step of StepPrecedence must not be the same. context StepPrecedence inv: self.precedingstep->forall( p self.succeedingstep->forall( q p <> q ) ) Daniel T. Chang (Copyright 2001) 34
Conclusion Daniel T. Chang (Copyright 2001) 35
CWM: Past and Present Past OMG Adopted Specification: 6/12/2000 CWM FTF: 3/10/2000 3/2/2001 CWM Enablement Showcase: 12/22-23/2000, 3/6-7/2001 CWM 1.0: 4/23/2001 Present CWM RTF: 3/2/2001 present CWM Metadata Interchange Patterns RFP & CWM Web Services RFP: 4/27/2001 - present Daniel T. Chang (Copyright 2001) 36
CWM Enablement Showcase Daniel T. Chang (Copyright 2001) 37
OMG MDA Daniel T. Chang (Copyright 2001) 38
http://www.cwmforum.org Daniel T. Chang (Copyright 2001) 39