urbanisation-si.com

urbanisation-si.com

Ingénierie Dirigée par les Modèles : métamodèle de mindmap, en veux tu en voilà

metamodele-mindmap-heritage-ecore.png

Mes 2 derniers articles :

https://www.urbanisation-si.com/ingenierie-dirigee-par-les-modeles-les-metamodeles-mindmap-l-embarras-du-choix

et  https://www.urbanisation-si.com/ingenierie-dirigee-par-les-modeles-metamodele-simplifie-de-mindmap

a permis de présenter 2 exemples de métamodèle de mindmap.

En voici un autre utilisant l'héritage.

 

Voici comme à notre habitude le source XMI du fichier Ecore :

 

<?xml version="1.0" encoding="UTF-8"?>
<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="mindmap" nsURI="http://www.eclipse.org/2008/mindmap" nsPrefix="mindmap">
<eClassifiers xsi:type="ecore:EClass" name="Map">
<eStructuralFeatures xsi:type="ecore:EReference" name="elements" upperBound="-1"
eType="#//MapElement" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="title" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="created" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDate"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="rootTopics" upperBound="-1"
eType="#//Topic" volatile="true" transient="true" derived="true">
<eAnnotations source="http://www.eclipse.org/2007/OCL">
<details key="derive" value="let topics : Set(mindmap::Topic) = self.elements->select(oclIsKindOf(mindmap::Topic))->collect(oclAsType(mindmap::Topic))->asSet() in topics->symmetricDifference(topics.subtopics->asSet())"/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="MapElement" abstract="true">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
defaultValueLiteral="Element"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Topic" eSuperTypes="#//MapElement">
<eOperations name="allSubtopics" upperBound="-1" eType="#//Topic">
<eAnnotations source="http://www.eclipse.org/2007/OCL">
<details key="body" value="self->closure(subtopics)"/>
</eAnnotations>
</eOperations>
<eStructuralFeatures xsi:type="ecore:EReference" name="subtopics" upperBound="-1"
eType="#//Topic" eOpposite="#//Topic/parent"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="description" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="start" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDate"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="end" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDate"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="priority" eType="#//Priority"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="parent" eType="#//Topic"
eOpposite="#//Topic/subtopics"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Relationship" eSuperTypes="#//MapElement">
<eStructuralFeatures xsi:type="ecore:EReference" name="source" lowerBound="1"
eType="#//Topic"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="target" lowerBound="1"
eType="#//Topic"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="type" eType="#//Type"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EEnum" name="Type">
<eLiterals name="DEPENDENCY" literal="d"/>
<eLiterals name="INCLUDE" value="1" literal="i"/>
<eLiterals name="EXTEND" value="2" literal="e"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EEnum" name="Priority">
<eLiterals name="HIGH"/>
<eLiterals name="MEDIUM" value="1"/>
<eLiterals name="LOW" value="2"/>
</eClassifiers>
</ecore:EPackage>

 Il nous restera un petit dernier pour un prochain article.

 

"Les grands principes participants du bonheur sont : quelque chose à faire, quelque chose à aimer, et quelque chose à espérer."
Allan K. Chalmers

 

Voir aussi :  

 

http://urbanisation-si.wix.com/blog

http://urbanisme-si.wix.com/blog

http://urbanisation-si.wix.com/urbanisation-si

http://urbanisation-si.over-blog.com/

http://rhonamaxwel.over-blog.com/

http://urbanisation-des-si.blogspot.fr/

http://bonnes-pratiques-si.eklablog.com/

http://urbanisation-si.eklablog.com/



10/09/2015
0 Poster un commentaire

A découvrir aussi


Inscrivez-vous au site

Soyez prévenu par email des prochaines mises à jour

Rejoignez les 717 autres membres