## EMF Implementation

This component provides a ECore definition of KDM and a EMF implementation of the classes defined by this standard.

## KDM to UML Converter

The goal of the KDM to UML converter plug-in is to allow practical transformations of KDM models to UML models.

### Description

This tool aims at converting KDM models into UML models in order to allow integrating KDM-compliant tools (i.e. discoverers) with UML-compliant tools (e.g. modelers, model transformation tools, code generators, etc), as shown in the next figure.

The converter is mainly implemented by an ATL model-to-model transformation taking as input a model conforming to the KDM meta model and producing as output a model conforming to the KDM models into UML meta model.

The mapping between KDM and UML is described in the following table:

+KDM to UML mapping
KDM | UML
--- | ---
LanguageUnit | Package
CodeModel | Model
CodeAssembly | Model
Package | Package
ClassUnit | Class
InterfaceUnit | Interface
MethodUnit | Operation
ParameterUnit | Parameter
Extends, Implements | Generalization
PrimitiveType | PrimitiveType
MemberUnit | Property, Association

This mapping can be changed or completed easily by updating the ATL rules.

The converter can also generate a trace file of the transformation to UML and a transformation log.

### Requirements

To use the plug-in you need:

- JDK 1.5 or above
- a version of Eclipse 3.3 or above with the following set of plug-ins installed
  - EMF 2.3.0 or higher
  - ATL 2.0.0 or higher
  - UML 2.1.0 or higher
  - KDM 1.0.0 or higher

### Install

#### Sources

You will find a version of this plug-in in SVN repository.

Here are installation instructions :

- Import the project in your workspace using a SVN client.
- Use the "export" menu to export this project as a plug-in (Deployable plug-ins and fragments) in your Eclipse installation. Don't forget to choose the "Package plug-ins as individual jar archives" option.
- Re-start your Eclipse to take this plug-in into account.

Connection parameters to the SVN repository: MoDisco/SVN.

#### Runtime

You could download an archived site or use the update site of MoDisco.

### User manual

The plug-in also provides the user with a contextual menu in order to create models easily. By right-clicking on a KDM model in the Eclipse Package Explorer view you can generate the UML model, with or without traces (see next figure).

From a KDM source model:

We obtain a UML target model :

This UML model can be displayed in any modeler:

### Current Limitations

The bidirectional UML Association elements are not identified by the rules: two complementary unidirectional UML Association elements are generated.

Category:MoDisco

## KDM Source Discoverer

The goal of the KDM Source Discoverer plug-in is to allow practical extractions of KDM Source models from the file hierarchy of an application.

### Details

This plug-in aims at analyzing the file system hierarchy of an application and providing a model describing the information found, conforming to KDM Source sub package. (see next Figure)

The Source package defines a set of meta-model elements whose purpose is to represent the physical artifacts of the existing system, such as source files, images, configuration files, resource descriptions, etc.

For an input folder, the KDM source discoverer visit each folder and file. For each file, it creates the appropriate sub class of InventoryItem using the Resources content type API. This plugin defines its own content types to properly classify file types.

### Requirements

To use the plug-in you need:

- JDK 1.5 or above
- a version of Eclipse 3.3 or above with the following set of plugins installed
  - EMF 2.3.0 or higher
  - KDM metamodel

### Source Repository

All of the source code is stored in a public source repository, which you can access at:

https://dev.eclipse.org/svnroot/modeling/org.eclipse.gmt.modisco/plugins/trunk/org.eclipse.gmt.modisco.kdm.source.discoverer/

You can also browse it through the Web interface.

### User manual

The plug-in provides the user with a contextual menu to easily create models.

By right-clicking on a container (folder or project) in the Eclipse Package Explorer view, you can quickly create the KDM Source model of your application (see next Figure). Each of these models can then be used with any other tool compliant with the corresponding metamodel.

A progress bar will appear at the bottom of the window as soon as the operation begins. Depending on the size of your application, the reverse engineering might take some time to complete (see next Figure).

At the end of the process, the newly created model file is added at the root of your project and is automatically opened in the default editor (see next Figure).

It can be opened in MoDisco model browser (see next Figure) which brings some graphical improvements.

Category:MoDisco

### Updating This Document

This document is maintained in a collaborative wiki. If you wish to update or modify this document please visit http://wiki.eclipse.org/MoDisco/Components/KDM/Documentation/0.8