Model Repositories Model Repositories (XMI, JMI, EMF) (XMI, JMI, EMF) by Luciana de Paiva Silva Luciana de Paiva Silva [email protected]www.cin.ufpe.br/~lps Disciplina : IN0980-MDA, Components and Software Reuse Professor Professor : : Jacques Robin
Model Repositories (XMI, JMI, EMF). by Luciana de Paiva Silva [email protected] www.cin.ufpe.br/~lps Disciplina : IN0980- MDA, Components and Software Reuse Professor : Jacques Robin. OUTLINE. Model repositories Requirements and services Model manipulation formats Programming objects - PowerPoint PPT Presentation
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Model RepositoriesModel Repositories(XMI, JMI, EMF) (XMI, JMI, EMF)
Model manipulation formats• Programming objects• XML document
Exemplos (ZoooMM, AM3, ReMoDD)
Existing tools• XMI • JMI• EMF
3
What is a model repository?What is a model repository?
Ideally: combine services from project artifact management system and model base management system
Services: Persistence and fault tolerance Concurrent and authenticated access control Version control Model query Model conformity to meta-model Model creation through meta-model instantiation API to connect a variety of model manipulation tools
The goal of AM3 (ATLAS MegaModel Management) is to provide a practical support for modeling in the large. The objective is to deal with global resource management in a model-engineering environment. We base this activity on the concept of a "megamodel".
Features: Management of various artifacts
Management of various relations between artifacts
Sharing and exchange of megamodel elements
User interfaces for viewing (browsing, creating, changing, etc.) megamodel elements
XML Metadata Interchange (XMI)XML Metadata Interchange (XMI)
XML Metadata Interchange (XMI) provê o mecanismo para implementar a distribuição de modelos entre ferramentas de diferentes empresas e entre repositórios, ou seja, intercâmbio de metadados entre ferramentas de modelagem.
Integra três padrões: XML, UML, MOF Padrão OMG para codificar modelos de documentos XML em
conformidade com o padrão MOF meta-model Permits automated generation of:
An XML schema document from a MOF meta-model and vice-versa
An XML document from a model and vice-versa
XML document generated from model is valid with respect to the XML schema document generated from the model’s meta-model
Model generated from XML document conforms to the meta-model generated from the XML schema of the XML document
13
XMI SimplifiedXMI Simplified
XML Streams (Models) (Many - based on each metamodel DTD
XML Schema (MetaModels)
(1 per metamodel used for validation)
XMLSyntax and Encoding
MOFMetadata Definitions
& Management
XMI
UMLMetamodel
Analysis & Design
UML
UML Models UML
CWM Models UML
MOF MetaModels
Validate
14
XMI DocumentXMI Document
Every XMI document consists: An XML version processing instruction. Example: <? XML
version=”1.0” ?> An optional encoding declaration that specifies the
character set, which follows the ISO-10646 (also called extended Unicode) standard. Example: <? XML version=”1.0” ENCODING=”UCS-2” ?>
Any other valid XML processing instructions. A schema XML element. An import XML element for the XMI namespace.
15
Example of MOF meta-model’s serializationExample of MOF meta-model’s serializationas XML Schema using XMIas XML Schema using XMI
systemname
*0 ..*
extends
includes
useCase
title0 ..1
actorname
<xsd:schema xmlns:xsd=’http://www.w3.org/2005/XMLSchema’><xsd:complexType name = umlModel> <xsd:complexType name = actor> <xsd:sequence> <xsd:element name = “name” type = “xsd:string”/> </xsd:sequence> </xsd:complexType> <xsd:complexType name = “useCase”> <xsd:sequence> <xsd:element name = “title” type = “xsd:string”/> </xsd:sequence> </xsd:complexType> <xsd:complexType name = “system”> <xsd:sequence> <xsd:element name = “name” type = “xsd:string”/> </xsd:sequence> </xsd:complexType> <xsd:complexType name = “actor2useCase” isDirected = “true” isAggregation = “false” isGeneralization = “false”> <xsd:sequence> <xsd:element from = “actor” minOccurs = “1” maxOccurs = “1”/> <xsd:element to = “useCase” minOccurs = “1” maxOccurs = “1”/> </xsd:sequence> </xsd:complexType> <xsd:complexType name = “system2useCase” isDirected = “true” isAggregation = “true” isGeneralization = “false”> <xsd:sequence> <xsd:element name = “from” ref = “system” minOccurs = “1” maxOccurs = “1”/> <xsd:element name = “to” ref = “useCase” minOccurs = “1” maxOccurs = “unbounded”/> </xsd:sequence> </xsd:complexType> <xsd:complexType name = “actorExtendsActor” isDirected = “true” isAggregation = “false” isGeneralization = “true”> <xsd:sequence> <xsd:element name = “from” ref = “actor” minOccurs = “1” maxOccurs = “1”/> <xsd:element name = “to” ref = “actor” minOccurs = “0” maxOccurs = “1”/> </xsd:sequence> </xsd:complexType>...</xsd:complexType>
extends
16
XMI SpecificationXMI Specification
17
Projeto UFPEProjeto UFPE
18
Projeto UNIOESTEProjeto UNIOESTE
Objetivos principais Estudo de diagramas i* gerados pela ferramenta OME na
linguagem TELOS
Estudo da tecnologia XML e o padrão XMI
Estudar o padrão XMI para implementar uma ferramenta computacional que possa mapear diagramas SD e SR (i*) para Diagramas de Caso de Uso UML.
Enables the implementation of a dynamic, platform-independent infrastructure to manage the creation, storage, access, discovery, and substitute of metadata.
JMI is based on the Meta Object Facility (MOF) For any MOF model, JMI defines the templates for
Data warehousing and BI Integration of DW/BI tools & frameworks
Component-based development and deployment (UML) Integration of tool suites/component frameworks
Enterprise information portals Integration of disparate data sources
Systems Management Hardware/software inventory, storage management
21
JMI Use-Cases
Data warehousing applications Different data sources, data warehouse formats, and analytical
tools Community – requires common interchange infrastructure to
provide a common programming model and a common interchange format
22
JMI Use-Cases
The Software Development Scenario Different tool for each task Different tools for the same task JMI as a platform for integrating heterogeneous software development tools to provide a complete software development
solution Large Enterprise JavaBeans™ (EJB) application (UML tools, Integrated Development Environments (IDEs), EJB deployment
tools) EJB development solution - built around JMI using three metamodels that represent the domains of the different tasks
Each tool participate – integrated solution through an adapter that maps the tool specific APIs to the JMI APIs for the respective model.
Reduce integration complexity
23
Java™ Metadata Interface(JMI) Specification
24
Eclipse ProjectEclipse Project
Provide open platform for application development tools Run on a wide range of operating systems
Each plug-in Contributes to 1 or more extension points
Optionally declares new extension points
Depends on a set of other plug-ins
Contains Java code libraries and other files
Lives in its own plug-in subdirectory
Details spelled out in the plug-in manifest Manifest declares contributions
Code implements contributions and provides API
plugin.xml file in root of plug-in subdirectory
28
Plug-in ManifestPlug-in Manifest
<plugin id = “com.example.tool" name = “Example Plug-in Tool" class = "com.example.tool.ToolPlugin"> <requires> <import plugin = "org.eclipse.core.resources"/> <import plugin = "org.eclipse.ui"/> </requires> <runtime> <library name = “tool.jar"/> </runtime> <extension point = "org.eclipse.ui.preferencepages"> <page id = "com.example.tool.preferences" icon = "icons/knob.gif" title = “Tool Knobs" class = "com.example.tool.ToolPreferenceWizard“/> </extension> <extension-point name = “Frob Providers“ id = "com.example.tool.frobProvider"/></plugin>
Declare contributionthis plug-in makes
Location of plug-in’s code
Other plug-ins needed
Plug-in identification
plugin.xml
Declare new extension point open to contributions from other plug-ins
29
EclipseEclipse
30
EMF is a modeling framework and code generation facility for building tools and other applications based on a structured data model.
From a model specification described in XMI, EMF provides tools and runtime support to produce a set of Java classes for the model, a set of adapter classes that enable viewing and command-based editing of the model, and a basic editor.
In a nutshell: it is to exchange models into Java code
lilaireRev1.pdf http://www.cs.york.ac.uk/puml/puml-list-archive/ http://zooomm.org/ http://planetmde.org/ http://www.eclipse.org/gmt/am3/ http://planetmde.org/gamma2006/ Bézivin, J, Jouault, F, and Valduriez, P : On the Need for Megamodels. In:
Proceedings of the OOPSLA/GPCE: Best Practices for Model-Driven Software Development workshop, 19th Annual ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications. 2004. Disponível em www.sciences.univ-nantes.fr/lina/atl/www/papers/OOPSLA04/bezivin-megamodel.pdf