160 likes | 185 Views
Data, Metadata, Metametadata, and a UML Virtual Machine. JavaBIN 1 August 2002. Trygve Reenskaug. http://www.ifi.uio.no/~trygver trygve.reenskaug@ifi.uio.no. OMG Model Driven Architecture. UML 2.0 Partners. From partners' presentation to OMG Nov 2001 (With permission).
E N D
Data, Metadata, Metametadata,and a UML Virtual Machine JavaBIN1 August 2002 Trygve Reenskaug http://www.ifi.uio.no/~trygver trygve.reenskaug@ifi.uio.no UML VM
UML 2.0 Partners From partners' presentation to OMG Nov 2001 (With permission) UML VM
U2P:The UML Architecture MOF CWM Core Profiles UML «import» «import» «import» «import» UML VM
U2P: Example ofFour-Layer Architecture of UML Class M3 (MOF) «InstanceOf» «InstanceOf» Attribute Class M2 (UML) «InstanceOf» «InstanceOf» Person age: Integername: String M1 (User model) «InstanceOf» :Person M0 (Run-time instances) age=11name_"Mike" UML VM
The Three Relative M-Levels • In other words, there are 3 M-levels, • the one you're thinking at, • the one above • and the one below. • The sooner we all grow out of trying to force things into • M0, M1, M2 or M3 the better. • There are no absolutes. • cheers • Sandy (R. Alexander Tyndale-Biscoe) UML VM
Metalayers for aSmall Program name "Person class" operations {new,main} attributes {name, operations, attributes,population} J2-metaclsss name "Person" "Person" operations setName...setAge... setName ..setAge .. J1-class attributes {"name", "age"} {"name", "age"} population {…} {…} "Mike" 11 name "Mike" J0-instance age 11 public class Person extends Object { public String name; public int age; public static Vector population = new Vector(); public void setName(String nam) { name = nam; } public void setAge(int num) { age = num; } public static void main (…) … { private Person inst; inst = new Person(); population.addElement (inst); inst.setName("Mike"); inst.setAge(11); inst.inspect(); } } public class Person extends Object { public String name; public int age; public static Vector population = new Vector(); public void setName(String nam) { name = nam; } public void setAge(int num) { age = num; } public static void main (…) … { private Person inst; inst = new Person(); population.addElement (inst); inst.setName("Mike"); inst.setAge(11); inst.inspect(); } } UML VM
InstanceOf-relationshipsSubclassOf-Relationships Object Object class Metaclass Person Metaclass class Person class Metaclass class InstanceOf-Relationships Metaclass Person class Object class Object Person Mike SubclassOf-Relationships UML VM
Metalayers for theModel of a Small Program name "Person class" Class M3 (MOF) operations new,main «InstanceOf» «InstanceOf» attributes {name, operations,attributes,population} Attribute Class M2 (UML) «InstanceOf» name "Person" "Person" «InstanceOf» operations setName ..setAge .. setName ..setAge .. Person age: Integername: String M1 (User Model) attributes {"name", "age"} {"name", "age"} population {…} {…} «InstanceOf» "Mike" :Person M0 (Run-time instances) 11 age=11name="Mike" name "Mike" age 11 J2-metaclsss J1-class J0-instance UML VM
Objects in the UML ModelThe "Person Class" object MOF::MetaClass MOF::Class name {name,attributes, operationDic} attributes {new, …} operations name "UML::Class" attributes {name, attributes, operations} operations {generate, …} name attributes operations "Person" {name,age} {setName,setAge} Class M3 (MOF) «InstanceOf» «InstanceOf» Attribute Class M2 (UML) «InstanceOf» «InstanceOf» Person age: Integername: String setName() setAge() M1 (User model) «InstanceOf» :Person age=11name="Mike" M0 (Run-time instances) UML-VM UML UML VM
Hjemmesnekret XML forJava Object and Class name "Person class" operations …,main attributes {"name" , "operations" ,"population" } J2-metaclsss name "Person" "Person" operations setName ..setAge .. setName ..setAge .. J1-class attributes {"name", "age"} {"name", "age"} population {…} {…} Person "Mike" 11 name "Mike" J0-instance age 11 <Java::Class> <name>Person</class> <attribute>name...</attribute> <attribute>age...</attribute> <operation>setName…</operation> <operation>setAge…</operation> </Java::Class> <Java::Class> <name>Person</class> <attribute>name...</attribute> <attribute>age...</attribute> <operation>setName…</operation> <operation>setAge…</operation> </Java::Class> <Java::Object> <class>Person</class> <name>Mike</class> <age>11</age> </Java::Object> <Java::Object> <class>Person</class> <name>Mike</class> <age>11</age> </Java::Object> UML VM
Hjemmesnekret XML for class model (M1) Person MOF::MetaClass MOF::Class {name,attributes, operationDic} {new, …} MOF::Class "UML::Class" {name, attributes, operations} {generate, …} UML::Class "Person" {name,age} {setName,setAge} name attributes operations <UML::Class> <name>Person</name> <attribute> <name>name</name> <type>String</type> </attribute> <attribute> <name>age</name> <type>Integer</type> </attribute> <operation>…</operation> ... </UML::Class> <UML::Class> <name>Person</name> <attribute> <name>name</name> <type>String</type> </attribute> <attribute> <name>age</name> <type>Integer</type> </attribute> <operation>…</operation> ... </UML::Class> name attributes operations name attributes operations UML-VM XML/XMI UML VM
Hjemmesnekret XML for metaclass UML::Class MOF::MetaClass name MOF::Class attributes {name,attributes, operationDic} operations {new, …} <MOF::Class> <name>UML::Class</name> <attribute>name</attribute> <attribute>attributes</attribute> <attribute>operations</attribute> <operation>generate…</operation> ... </MOF::MetaClass> <MOF::Class> <name>UML::Class</name> <attribute>name</attribute> <attribute>attributes</attribute> <attribute>operations</attribute> <operation>generate…</operation> ... </MOF::MetaClass> MOF::Class name "UML::Class" attributes {name, attributes, operations} operations {generate, …} UML::Class name "Person" attributes {name,age} operations {setName,setAge} UML-VM XML/XMI UML VM
Hjemmesnekret XML for metametaclass MOF::Class <MOF::MetaClass> <name>MOF::Class</name> <attribute>attributes</attribute> <attribute>operations</attribute> <attribute>operations</attribute> <operation>new…</operation> ... </MOF::MetaClass> <MOF::MetaClass> <name>MOF::Class</name> <attribute>attributes</attribute> <attribute>operations</attribute> <attribute>operations</attribute> <operation>new…</operation> ... </MOF::MetaClass> MOF::MetaClass name MOF::Class attributes {name,attributes, operationDic} operations {new, …} MOF::Class name "UML::Class" attributes {attributes, operations, name} operations {generate, …} UML::Class name "Person" attributes {name,age} operations {setName,setAge} UML-VM XML/XMI UML VM
More details …. http://www.ifi.uio.no/~trygvertrygve.reenskaug@ifi.uio.no Trygve Reenskaug: "A Rudimentary UML Virtual Machine "http://www.ifi.uio.no/~trygver/documents/2002-01-UMLVM/uml-vm-04.pdf Unified Modeling Language (UML).Object Management Group. Version 1.4, Formal version, September 2001. http://www.omg.org/technology/documents/formal/uml.htm Version 2.0, One of initial proposals, http://www.u2-partners.org/ Model Driven Architecture (MDA) http://www.omg.org/mda/ UML VM