object interchange with xmi - object management group

65
Object Interchange with XMI Stephen Brodsky June 2000

Upload: others

Post on 03-Feb-2022

7 views

Category:

Documents


0 download

TRANSCRIPT

Object Interchange with XMI

Stephen Brodsky

June 2000

Object Interchange with XMI

Introduction to UMLNovember 1999, Cambridge, US

Behavioral Modeling with UMLJanuary 2000, Mesa, Arizona, US

Advanced Modeling with UMLMarch 2000, Denver, US

Metadata Integration with UML, XMI and MOFJune 2000, Oslo, Norway

Tutorial Series

Object Interchange with XMI

Tutorial Goals

What you will learn:what the UML is and what is it notUML’s basic constructs, rules and diagram techniqueshow the UML can model large, complex systemshow the UML can specify systems in an implementation-independent manner

how UML, XMI and MOF can facilitate metadata integration

What you will not learn:Object ModelingDevelopment Methods or Processes

Metamodeling

Object Interchange with XMI

XMI Quick Tour

XMI is an XML language to interchange the objects of software systems:

UML/MOF designsComputer software classes and interfacesDatabases and database schemas

DTDs and XML schemas

Added to the list of OMG adopted technologies in February 1999 as XMI 1.0Most recent minor revision is XMI 1.1 (February 2000)

Object Interchange with XMI

XMI Goals

Provide a general purpose object interchangeLeverage XML technologyLeverage UML/MOF technologyConsistent look-and-feelSupport data, meta-data, meta-meta-data, ...ExtensibleScales from simple to enterprise

Object Interchange with XMI

OMG XMI Evolution

XMI 1.0Uses MOF 1.1, XMI 1.0 (DTDs)Finalized Oct 1998, adopted Feb 1999Supported by 29+ companies

XMI 1.1Uses MOF 1.3Adds XML NamespacesFinalized Nov 1999, adopted Feb 2000

XMI 2.0 - initial submissionAdds XML SchemaAdds Schema/DTD reverse engineering

Object Interchange with XMI

XMI Topics

XMLXMI 1.1XMI Applications

ToolsRepositoriesMessaging

XMI for XML Schema

Object Interchange with XMI

XML Overview

Standard of the W3C in 1998DocumentsDTDNamespaceAPIs: DOM and SAXOthers: XSLT, XPath, XLinkFuture: XML Schema

Object Interchange with XMI

XML document<Car year="2000">

<Engine cylinders="6" /><Door side="left" /><Door side="right" />

</Car>

XML DTD<!ELEMENT Car (Engine, Door*)><!ATTLIST Car year CDATA #IMPLIED>

XML Example

Object Interchange with XMI

XML document<Car year="2000">

<Engine cylinders="6" /><Door side="left" /><Door side="right" />

</Car>

XML DTD<!ELEMENT Car (Engine, Door*)><!ATTLIST Car year CDATA #IMPLIED>

XML Example

element

attribute

content

start tag

end tag

Object Interchange with XMI

XML document<Car year="2000">

<Engine cylinders="6" /><Door side="left" /><Door side="right" />

</Car>

XML DTD<!ELEMENT Car (Engine, Door*)><!ATTLIST Car year CDATA #IMPLIED>

XML Example

multiplicity

attribute

element

content

Object Interchange with XMI

XML document<Car year="2000">

<Engine cylinders="6" /><Door side="left" /><Door side="right" />

</Car>

XML DTD<!ELEMENT Car (Engine, Door*)><!ATTLIST Car year CDATA #IMPLIED>

XML Example

element

attribute

content

multiplicity

start tag

end tag

attribute

element

content

Object Interchange with XMI

XML in Action

1. Export: XML document written to file or stream2. Delivery: Passed to import software3. Import: Parse XML document,

Validate using DTD or Schema (optional)

Application1 Application2Document

DTD or Schema

Validate

Export Import

Object Interchange with XMI

XMI Topics

XMLXMI 1.1XMI Applications

ToolsRepositoriesMessaging

XMI for XML Schema

Object Interchange with XMI

The Solution-Centric World

,QWHUQHW

-DYD

;0/

2EMHFWV

Object Interchange with XMI

XMI: Sharing Objects

XML - Sharing DataXMI - Sharing Objects

Creates custom XML DTDs/SchemasXML documents

from class definitions.

Objects

Data

Text

XMI

XML

Unicode

Objects

Data

Text

Internet Key:Application1 Application2

Object Interchange with XMI

<Car> <doors>4</doors> <color>red</color></Car>

<auto doors="4" color="red"/>

Class Automobile { int numDoors; Color color;}

Concept-inspired XML

<!ELEMENT Vehicle (door*)><!ATTLIST Vehicle Color CDATA #IMPLIED>

Object Interchange with XMI

<Auto> <Color>red</Color> <Door>4</Door></Auto>

Class Auto { Color color; Door[] door;}

Metadata-driven XMI

<element name="Auto/>

<!ELEMENT Auto (Color*, Door*)>

DoorColor

Auto

docGen

DTDGen

codeGen

UML MOF

Services of the XMI Toolkit

XMI Document

XMI Schema & DTDJava, IDL

Object Interchange with XMI

<Auto> <Color>red</Color> <Door>2</Door></Auto>

Design-driven XMI for a car

<element name="Auto" /><!ELEMENT Auto (Color*, Door*)>

DoorColor

Auto

Objects and Designs

XMI Document

XMI DTD, Schema

<Class> <Name>Auto</Name></Class>

Model in XMI

Model Interchange

Instance Interchange

Object Interchange with XMI

XMI documents, DTDs, messages, data store

Software Applications,

InterfacesSource code

Business-driven Object Architecture

DoorColor

Auto

Objects and Designs UML, MOF

Services of the XMI Toolkit

Information XMI

Business Assets

Execution

EDIDB Schemas

ClassesIndustry standards

Object Interchange with XMI

Approaches to interchange

7RS�'RZQ

%RWWRP�XS

([FKDQJH�)RUPDW� �'7'

$GGUHVV

1DPH 6WUHHW *HQHUDWH

'DYLG�)DOOVLGH����%DLOH\�$YHQXH

*HQHUDOL]H

$VKRN�0DOKRWUD���6DZ�0LOO�5LYHU�5G

Object Interchange with XMI

XMI Exchange Scenario

$GGUHVV

1DPH 6WUHHW

Application1 Application2XMI Doc

XMI DTD

*HQHUDWH

Object Interchange with XMI

XML Parser

XMLDocument

Application Objects

Application Software

XML Tag Tree

XML DTD

XMI ToolkitXML Parser

XMIDocument

Application Objects

Application SoftwareXMI DTD

XMI Object Serialization

XML

XMI

transform

Object Interchange with XMI

Validation in XMI

Objects(XMI Document)

GeneratedXML DTD/Schema

MOF model(XMI Document)

XML Parser

optionalsyntactic validationsemantic validation

well-formed

generate

Model

Instance

Object Interchange with XMI

Well-formedNo: 15>LS<<y99>/4Yes: <Car />

Syntactic<!element Car (Door+)>No: <Car />

Yes: <Car><Door/></Car>

SemanticNo: Cow jumped over the moonYes: Rocket flew to the moonYes: <Car><Door/><Door/><Door/><Door/></Car>

Validation

XML Parser

XML DTD/Schema

MOF model

Object Interchange with XMI

XMI Object Mapping

ClassObject typed attributeContainmentReferenceBasic attribute (int, String)

MOF Concept

XML element, odd levelsXML element, even levelsXML element, even levelsXML attribute IDREFXML attribute CDATA

XML Concept

Object Interchange with XMI

Class Car { // ClassString color; // Field, StringPerson customer; // Field, ReferenceEngine standardEngine; // Field, ObjectEngine optionalEngine; // Field, Object

}

XMI Mapping Example

<Car color="Blue" customer="Joe"><Car.standardEngine>

<Engine ..... /><Car.standardEngine><Car.optionalEngine>

<Engine ..... /></Car.optionalEngine>

</Car>

Class definition

XMI instance

Object Interchange with XMI

Class Car { // ClassString color; // Field, StringPerson customer; // Field, ReferenceEngine standardEngine; // Field, ObjectEngine optionalEngine; // Field, Object

}

XMI Mapping Example

<Car color="Blue" customer="Joe"><Car.standardEngine>

<Engine ..... /><Car.standardEngine><Car.optionalEngine>

<Engine ..... /></Car.optionalEngine>

</Car>

XML element, odd levelsXML element, even levelsXML attribute IDREFXML attribute CDATA

Object Interchange with XMI

XMI Architecture

Elements match information modelStandardized element structure

Sub-elements, contentsIdentity, Object idsLinkingExtensionsNavigation, associations

Standard transfer structure with headerDifferences (add, delete, replace)

Object Interchange with XMI

XMI - example UML model

Convertible

Car

mak emodel

drive()

Personownerowns<Class name="Car">

<Class.ownedElements><Attribute name="make"/><Attribute name="model"/><Operation name="drive"/>

</Class.ownedElements></Class>

Object Interchange with XMI

XMI - example of a Car

Convertible

Car

mak emodel

drive()

Personownerowns

<Car make="Ford" model="Mustang"/>

<!element Car><!attlist Car

make cdata #implied model cdata #implied

>

Car.xmlCar.xml

Car.dtdCar.dtd

Object Interchange with XMI

XMI - example, cont

Convertible

Car

mak emodel

drive()

Personownerowns

<Car xmi.id="4ABC123" make="Ford" model="Mustang" owner="John Doe"/><Person xmi.id="John Doe" owns="4ABC123"/>

<!element Car><!attlist Car

xmi.id id #implied make cdata #implied model cdata #impliedowner idref #implied>

<!element Person><!attlist Person

xmi.id id #implied owns idref #implied>

Car.xmlCar.xml

Car.dtdCar.dtd

Object Interchange with XMI

<XMI xmi.version="1.1" xmlns:uml="org.omg/uml1.3"><XMI.header>

<XMI.documentation>An example of an auto.

</XMI.documentation><XMI.metamodel name="UML" version="1.3"

href="uml1.3.xmi" /><XMI.model name="Cars" version="1.0" />

</XMI.header><XMI.content>

<Class name="Car"><Class.ownedElements>

<Attribute name="make"/><Attribute name="model"/><Operation name="drive"/>

</Class.ownedElements></Class>

</XMI.content></XMI>

XMI Example Document

content

header

metadata andversion

Object Interchange with XMI

XMI Identity and Linking

Identityid unique within this documentuuid unique across all documents

Linkingidref link to object within this documenthref+uuid link to object in any document

<Car xmi:uuid="4JFK196" color="blue" year="2000"/>

<Car xmi:uuid="4JFK196" href="http://cars.org/newCars.xml">

newCars.xml

carUser.xml

Object Interchange with XMI

XMI extensions

XMI.extension elementHelps bridge the gap between systems when performing round-trip interchangeExample: Two systems, each with their own id for an object

<Car xmi:uuid="4JFK196"><XMI.extension extender="NorwegDMV" extenderId="G166F97" />

</Car>

Vehicle id in US

Vehicle id in Norway

Object Interchange with XMI

XMI Differences

Interchange incremental differencesExpress differences in terms of another documentReduce quantity of information to transferCanonical differences:

AddDeleteReplace

Object Interchange with XMI

XMI Metadata and DTDs

DTD

Doc

DTD

Doc

DTD

Doc

MOF Java VM

UML Java C++, IDL Relational Database

Model .java, .class

.c, .h, .idl, .obj, .dll

Schema (cols)

Instances Instances Instances Data (rows)

Object Interchange with XMI

DTD Generation Example

Exchange DB schema (columns) and data (rows)

Database2

Data Document

Schema DTD

Database1RDB DTD

Schema Document

C1 C2 C3

R1

R2

R3

R4

R5

R6

*HQHUDWH

Object Interchange with XMI

XMI Summary

XML Metadata InterchangeEstablish an industry standard specification for a stream-based model format Provide a generic format that can be used to transfer a wide variety of models

StatusOMG standard - March 23, 1999XMI 1.1 - February 1, 2000XMI 1.2 in progressXMI production of XML Schema in progress

ValueGenerates DTDs (& Schemas soon) for interchangeGenerates XML documents using the DTDsLeverages available XML technologyUniform architecture for naming, linking, extensions, round-tripApplicable to UML, databases, messaging, repositories, tool interchange, CCM Components, Java, EJBsWill import DTDs and Schemas

Object Interchange with XMI

XMI Topics

XMLXMI 1.1XMI Applications

ToolsRepositoriesMessaging

XMI and XML Schema

Object Interchange with XMI

Integrating Tools

6 vendors (N)Write 30 bridges (N*N-N)Increased by product releases

;0,'HYHORSPHQW

7RROV

5HSRUWV'DWDEDVH6FKHPD

'HVLJQ6RIWZDUH$VVHWV

5HSRVLWRU\

App2

App4App5

App1

App6 App3

6 vendors (N)Write 6 bridges (N)

Object Interchange with XMI

XMI Open Scenarios

Interchange of information for...Object Oriented Analysis and Design (UML)

Data Warehouse (CWM)

Publish design metadata on the web

Leverage XML/HTML infrastructure that already exists

Open new integration paths between applicationsDesign tool XLanguage environment YDatabase Z

Object Interchange with XMI

UML MOFData

WarehouseBusinessObjects

Financial Transportation Simulation Life Sciences

ElectronicCommerce Telecom Manufacturing Utility

Domain

Platform

XMI and the OMG

Object Interchange with XMI

Where do DTDs come from?

Class Definitions

DB Schemas

Designs

Records, Structures

Importers Exporters

Hand-coded DTD/Schema

Generated DTD/Schema

MOF

Conceptual mapping?

XMI

Messages

Business Assets

OMG

Object Interchange with XMI

Consistent role-relevant views of software assetsShared definitions of data, code or components, with effortless interchange among tools

Virtual "global repository"

Federating Tools: Goals

Object Interchange with XMI

Federating Tools: Standards

Deliver assets ⇒ WebDAV+

Define their meaning ⇒ XMI⇓

Virtual "Global Repository"

Object Interchange with XMI

CapabilitiesOverwrite preventionPropertiesCollectionsName space managementVersion managementAccess control

Protocol method requestsget putpropfind proppatch mkcol index addref delref delete copy move lock unlock patchReferences are URIs

HT

TP

+ W

ebD

AV

Prot

ocol

Filesystem

Document Management

System

ConfigurationManagement

System

PersistentStorage Interface

RepositorySystem

Author

Dev

Mgr

Federating Tools with WebDAV:Distributed Authoring & Versioning

Object Interchange with XMI

Application object integration

9LHZ &RQWUROOHU

0RGHO02)�-0,�$3,

$SSOLFDWLRQ��

9LHZ &RQWUROOHU

0RGHO02)�-0,�$3,

$SSOLFDWLRQ��

&RPSRQHQW�5HSRVLWRU\

:HE'$9 :HE'$9

;0,�5HSRVLWRU\�&RPSRQHQW

;0,�5HSRVLWRU\�&RPSRQHQW

Object Interchange with XMI

Tools Architecture

Tools

XMI

MOF Common Components

Persistence/Repository/Files/DatabaseWebDAV

Foundation

Object Interchange with XMI

XML/XMI Messaging

Sender ReceiverMessageserialize invoke

ApplicationTool

object & datatypemapping

object & datatypemapping

SOAP4J uses XMI for object messaging

Object Interchange with XMI

XMI Messaging

1. Export: XMI message written to file or stream2. Delivery: Passed to import software3. Import: Parse XMI message

Application1 Application2Message

DTD or Schema

Validate

Export Import

<Order number="123456"><contents>

<Car make="Ford" model="Mustang"/></contents>

</Order>

Object Interchange with XMI

XMI in Messaging

The fundamental infrastructure necessary to support generic XML-based object messaging requires:1. an object model, = MOF2. a set of data types, = MOF Language Models3. interface specifications, = MOF Application Models4. an XML serialization format. = XMI

Object Interchange with XMI

XMI companies

IBMUnisysOracleRationalInlineHyperionDimension EDIGenesisNovosoft

SofteamOntogenicsNCRUBSTogetherSoftObjectsByDesignArgo at UCIObjecteeringAonix

Object Interchange with XMI

XMI used by

WebSphere EnterpriseVisualAge for JavaSan Francisco projectApplication Framework for e-Business UML, MOF, CCM XMI DTDsCWM, Java, EJB XMI DTDsXMI Toolkit (AlphaWorks, VADD)Unisys UREP, Integrate+Oracle Designer 2000More on the way...

IMS, manufacturing, insurance, MQ

Object Interchange with XMI

IBMVisualAge

Select

UnisysUREP

OracleRepository

RoseDTDGen

Enterprise

MOFDTDGen

RationalRose

SelectEnterprise

OracleDesigner

XMI

XMIXMI

XMI

XMI

XMI

XMIXMI

XMI

TeamConnection

WebSphere VA Java

XMI Proof of Concept(OMG demo - November 1998)

Object Interchange with XMI

XMLXMI 1.1XMI Applications

ToolsRepositoriesMessaging

XMI and XML Schema

XMI Topics

Object Interchange with XMI

XMI Production of XML Schema

Initial submissionGenerate XML Schemas to match XMI 1.1

XMI 1.1 documents identicalBackwards compatibleUse either DTDs or Schemas

Generate XMLSchemas for XMI 2.0Uses new featuresNot backwards compatible with DTDs

Import XML Schemas and DTDs

Object Interchange with XMI

Validation in XMI

Objects(XMI Document)

GeneratedXML DTD/Schema

MOF model(XMI Document)

XML Parser

semantic validationoptional

syntactic validation

well-formed

generate

Model

Instance

Object Interchange with XMI

XML Schema is ...

A working draft of the W3C since 1998Syntactic validation XML documents with more expressive power than DTDsDefines nested data structuresUses XML syntaxUses XML Namespaces

(DTDs could also support XML Namespaces)

Supports single extension pointsSupports a simple set of data types

Object Interchange with XMI

XML Schema is not ...

SimpleFastConcise

Twice the size of DTDs (ComplexTypes & Element declarations)

Generally extensibleMultiple extension points not supported

For semantic validationFor defining objects

Object Interchange with XMI

UML vs DTD/XML Schema

UMLHigh level object-oriented conceptsDesigned for human comprehensibilityInformation structure plus dynamicsExample concept:

"What relationships and scenarios do these business objects participate in?"

DTD/XML SchemaDesigned for XML document validationExample concept:

"This XML element contains that elemement zero or more times."

Less information than databases and software need for robust interchangeCaptures only a portion of the static information

Object Interchange with XMI

Standardizing Schemas without models is insufficient

XML is primarily a serialization technologySchemas cannot capture semantics of metamodelsSchema mapping rules from metamodel must be consistent across applicationsVersion DTD/Schemas with metamodel Architecture / consistency across DTD/Schemas

new features can be rapidly incorporatedcommon look and feellinking, ids, differences, extensions, ...leverage XML advances coherently

Object Interchange with XMI

XML Validation Compared

DTDDeclares elements and attributesDeclares element containment

Specify both order and multiplicity

SchemaDeclares elements and attributesDeclares element containmentLimited: Specify order and/or multiplicityLimited: Substitute one element for anotherLimited: Extend previously declared elements

Syntactic, not semantic validationMust keep in synch (generate) with classesUse Classes, not Schemas for Object definitions

Object Interchange with XMI

XMI / XML Schema challenges

Multiple extension defined by MOF/UML needed for multiple inheritanceSubstitutability and extension concepts are intertwinedRequiring base content first interferes with mutple extensionsExtended groups cannot mix with base contentSuggest: Mapping types to elements leads to extra complexity

Object Interchange with XMI

XMI Object Interchange

Questions?

[email protected]

For more info:www.omg.orgalphaworks.ibm.com