BodyModelingLanguage

De wikiPLII
Saltar a: navegación, buscar
BodyModelingLanguage
The Body Modeling Language
helps you learn the different body organs and bones
Miembros Alecia Adelaide May Reid
Curso Académico 2016/2017
Tipo de Contribución DSL/Tool
Keywords Eclipse, Xtext, Sirius, Education, Biology, Human Body, Student



Contenido

Introduction

The The Body Modeling Language, DSL Project, development and objectives are explained in this wiki page.

The objectives of the Language are as shown below:

       - Make learning the human anatomy fun and easy through drag and drop.
       - A potent tool that will help teachers in the classrooms to teach their students the human anatomy in a fun and easy 
              to monitor way.
       - Provide a visual graphical editor that allows you to print out your work on the human anatomy
       - Attractive and user friendly that even your dad, granddad or aunty will use it.

It is also described the creation of The Graphic Editor using Sirius Modeling Tool (SMT).


Design and Development Procedure

What to expect in this section: In this section it is explained how to create a EMF Metamodel and describe how to create THEBODY metamodel. This metamodel defines 4 concepts and 3 relations that can be use to describe the human body:

The concepts are-: • TheBody • Section • Organ • Bone

The relations are-: • SectionOfTheBody from TheBody to Section. • OrganInSection from Section to Organ, with cardinality 0..*. • BoneInSection from Section to Bone with cardinality 0..*

Description of the attributes-:  
                 - The TheBody has a name of type EString and a type of btype (enum) {HUMAN, ALIEN}.
                 - A Section has a type of type stype (enum) {HEAD, NECK, CHEST, UPPER ARM, LOWER ARMS, UPPER BELLY, LOWER 
                        BELLY, FOOT, ETC.}
                 - TheBody has a relationship  SectionOfTheBody with Section. 
                 - A section has a collection of organs and bones.	
                 - The different organs like Heart, Brain, Kidneys, etc. inherit from Organ
                 - The different bones like Cranium, Femur, Humerus, etc. inherit from Bone
                 - Each section can only receive specific organ and bones to that section of the body.

Figure 1:- The Body Metamodel TheBodyMetamodel.png


Create the Metamodel

Install Ecore Tools -: The Eclipse Modelling Packages were used in the development of this project, using tools like Ecore Tools, Sirius, Acceleo, etc.

The easiest way to define a metamodel is to use Ecore Tools (based on EMF and Sirius), a graphical editor for Ecore models.

1. Create an Ecore Modelling Project -: In the Model Explorer View, right click on New->Other...

Figure 2:- Model Explorer View CreateEcoreModellingProject.png

2. In Ecore Modelling Framework select Ecore Modelling Project

Figure 3:- Ecore Modelling Framework SelectEcoreModelingFramework.png

After creating the Modelling Project, the Ecore Tools creates a project containing an Ecore model with an empty package and a blank diagram.

3. Create the elements of the metamodel -: The palette as seen below, was used to create the elements of the metamodel described previously.

Figure 4:- Create the Elements CreateTheElements.png

3.1. Class tools in the palette are used to create TheBody, Section, Organ and Bone. Use the properties view to set Section as abstract.

The model element edited the name of a (class, attribute, relation) directly from the diagram -: just click on a selected element to activate the label edition (let some time before the selection and the click to avoid triggering a double-clik).

3.2. Use the Attribute tool in the palette, or the popup, to create an attribute named name on TheBody.

Figure 5:- Attribute tool ClassTheBody.png

3.3. All the elements and relations are created using the palette. The Palette holds all the tools needed to design and develop the metamodel project for TheBody Metamodel. The Composition tool in the palette is used to create a composition relation named SectionOfTheBody between TheBody and Section.

Figure 6:- Composition relation named SectionOfTheBody RelationSectionOfTheBody.png

3.4. The SuperType tool in the palette was used to create the inheritance relations from Brain, Heart, Liver, Kidneys, Skin, Lungs, Intestine and Stomach to Organ. The OrganInSection relation between Organ y Section. As seen in the first figure.

3.5. The SuperType tool in the palette was used to create the inheritance relations from CervicalVertebrae, LumbarVertebrae, PelvicGirdle, Clavicle, Humerus, Ribs, Femur, UlnaRadius, TibiaFibu and Cranium to Bone. The BoneInSection relation between Bone y Section.As seen in the first figure.

4. Generate the source code of the Metamodel. In the Model Explorer, open the file body.genmodel and select the package body (this genmodel file contains a model that allows EMF to generate the Java code corresponding to the metamodel).

Figure 7:- Generate the source code Select body.genmodel.png

4.1. After the model is created, the files are generated as shown below. Through Generate All the following codes can be generated Model Code, Edit Code, Editor Code and Test Code which makes coding easy and seamlessly .

Figure 8:- Generated Model Code GenerateAll.png

5. Test the metamodel and launch a runtime to use the body concepts.

5.1. Launch a new runtime from the current Eclipse To launch a new eclipse application click on Run / Run Configurations and double click on Eclipse Application to get a New_configuration.

Figure 9:- Launch a new runtime RunConfigurations.png

5.2. In order to comfortably run Sirius in the new runtime, we add this option in the VM arguments : -XX:MaxPermSize=256m

Figure 10:- Run Sirius in the new runtime SiriusRunTime.png

6. Create a new Modeling Project -: In the newly launch eclipse right click in Model Explorer view New- >Modeling Project

Figure 11:- New Modeling Project ModelingProject.png

On the newly created project, right click on New > Other... As shown in figure 2.

7. In Example EMF Model Creation Wizards, select Body Model. Click on Next> button to create a Body Model. Select TheBody as the type of the root object in your new model and click on Finish.

Figure 12:- EMF Model Creation Wizards EMFmodel.png

7.1. To add elements to this model, right click on the TheBody element and select New Child -> Section from the menu.

Figure 13:- Create Section CreateSection.png

7.2. To add elements to this model, right click on the Section (HEAD) element and select an Organ or a Bone from the menu.

Figure 14:- Create Child Organ / Bone CreateChild.png

This part of the tutorial will guide while extending a basic modeling tool with many advanced features of Eclipse Sirius: • Edition tools: edge creation, edge reconnection, element deletion, label edition • Graphical improvements: styles customization • Complexity management: layers, filters, validation rules, quick fixes • Other kinds of representations: containers, bordered nodes, tables, navigation between representations • Extensions: Java services

A basic modeling tool which simply allows the user to graphically represent Organs and Bones of a Section and Sections of TheBody of type

Figure 15:- Graphically Representation G-body.png


Technical Documentation

Eclipse: is the main IDE of the project that has been used to develop the majority of components Ecore: is Integrated in Eclipse, it provides a visual publisher and a scheme with tree structure that is used for the design of the metamodelo. Sirius: is integrated in Eclipse, by means of the editing of a scheme with tree structure, it has been used to create a visual publisher being based on metamodelo. Acceleo: is integrated in Eclipse, and is used to generate the code for The Body.


Downloads

The project's presentation Archivo:IIAProjectAleciaAdelaideMayReid.pdf

Herramientas personales
Espacios de nombres

Variantes
Acciones
Navegación
Herramientas