mia-software at eclipse modeling symposium 2010

17
Copyright © 2010 Mia-Software All Rights Reserved Copyright © 2010 Mia-Software All Rights Reserved Frédéric Madiot, Mia-Software Grégoire Dupé, Mia-Software Using EMF to represent Eclipse 3.x Plug-ins

Upload: fmadiot

Post on 13-Jan-2015

1.830 views

Category:

Technology


2 download

DESCRIPTION

This presentation explains how to create EMF models to describe existing plug-ins developped for Eclipse 3.x

TRANSCRIPT

Page 1: Mia-Software at Eclipse Modeling Symposium 2010

Copyright © 2010 Mia-Software All Rights Reserved

Copyright © 2010 Mia-Software All Rights Reserved

Frédéric Madiot, Mia-Software

Grégoire Dupé, Mia-Software

Using EMF to represent Eclipse 3.x Plug-ins

Page 2: Mia-Software at Eclipse Modeling Symposium 2010

Copyright © 2010 Mia-Software All Rights Reserved

Copyright © 2010 Mia-Software All Rights Reserved

Software artifacts : - source code

- configuration files - tests

- database - …

ExistingSoftware System

Discover

Models

use Models to represent and manipulate

artifacts of existing systems

Understand

Viewpoints

Transform

NewSoftware System

MoDisco

http://www.eclipse.org/MoDisco/

Page 3: Mia-Software at Eclipse Modeling Symposium 2010

Copyright © 2010 Mia-Software All Rights Reserved

Copyright © 2010 Mia-Software All Rights Reserved

Supported Technologies

Infrastructure

MoDisco Architecture

Java Metamodel Discoverer Generator Transfo. to KDM

XML Metamodel Discoverer Generator

Model Browser

Navigation through

complex models

Customization & Extensibility

Definition ofspecific

Viewpoints

DiscoveryManager

Plug and orchestratetransformations

Eclipse Modeling projects

JSP Metamodel Discoverer Generator

OMG/ADMStandards

PivotMetamodels

(SMM & KDM)

EclipsePlugin

Metamodel Discoverer

Page 4: Mia-Software at Eclipse Modeling Symposium 2010

Copyright © 2010 Mia-Software All Rights Reserved

Copyright © 2010 Mia-Software All Rights Reserved

Model-DrivenReverse-Engineering

of Eclipse plug-ins

Page 5: Mia-Software at Eclipse Modeling Symposium 2010

Copyright © 2010 Mia-Software All Rights Reserved

Copyright © 2010 Mia-Software All Rights Reserved

Anatomy of an Eclipse 3.x Plug-in

MANIFEST.MF

plugin.xml

Source code

build.properties

plugin.properties

.project

.classpath

files

folders

Eclipse Plug-in

Heterogeneity !

Page 6: Mia-Software at Eclipse Modeling Symposium 2010

Copyright © 2010 Mia-Software All Rights Reserved

Copyright © 2010 Mia-Software All Rights Reserved

Demo

Using EMF to describe a Plug-in

MANIFEST.MF

plugin.xml

Source code

build.properties

plugin.properties

.project

.classpath

files

folders

Eclipse Plug-in

Project’s structure(KDMSource)

.project (XML)

.classpath (XML)

manifest

build.properties(KDMCore)

plugin(eclipseplugin)

Java source code(Java)

plugin.properties(KDMCore)

extensions (XML)Homogeneity !

Page 7: Mia-Software at Eclipse Modeling Symposium 2010

Copyright © 2010 Mia-Software All Rights Reserved

Copyright © 2010 Mia-Software All Rights Reserved

Demo

Page 8: Mia-Software at Eclipse Modeling Symposium 2010

Copyright © 2010 Mia-Software All Rights Reserved

Copyright © 2010 Mia-Software All Rights Reserved

Demo

Page 9: Mia-Software at Eclipse Modeling Symposium 2010

Copyright © 2010 Mia-Software All Rights Reserved

Copyright © 2010 Mia-Software All Rights Reserved

Demo

Page 10: Mia-Software at Eclipse Modeling Symposium 2010

Copyright © 2010 Mia-Software All Rights Reserved

Copyright © 2010 Mia-Software All Rights Reserved

What can you do with the EMF model

of a plug-in ?

Page 11: Mia-Software at Eclipse Modeling Symposium 2010

Copyright © 2010 Mia-Software All Rights Reserved

Copyright © 2010 Mia-Software All Rights Reserved

Quality Analysis

Check plug-in development rules

Use EMF APIS to detect problems in the model of the Plug-in

Store violations as Measurements into a SMM model

Inject violations into the Problem View

ExistingPlug-in

Model of the Plug-in

Model of the violations Problem View

Demo

Page 12: Mia-Software at Eclipse Modeling Symposium 2010

Copyright © 2010 Mia-Software All Rights Reserved

Copyright © 2010 Mia-Software All Rights Reserved

Quality Analysis

Examples of rules

Yearly simultaneous releaseVersion number ends with « qualifier »Source code must use ICU4J classesThe project must contain an « about.html » filePackages name should start with the plug-in IDPlug-in must not contain JARs filesPlug-in should contain only one « message.properties » and « Message.java » files

Mia-Software internal rules“PLUGIN_ID” variable of “Activator.java” should be initialized with the plug-in Id Plug-in Id and Project name should be equal«Bundle-Vendor» property value of « MANIFEST.MF » should be « %providerName »« plugin.properties » should declare a « providerName » property«Bundle-Name» property value of « MANIFEST.MF » should be « %pluginName »« plugin.properties » should declare a « pluginName » property

Page 13: Mia-Software at Eclipse Modeling Symposium 2010

Copyright © 2010 Mia-Software All Rights Reserved

Copyright © 2010 Mia-Software All Rights Reserved

Quality Analysis

Page 14: Mia-Software at Eclipse Modeling Symposium 2010

Copyright © 2010 Mia-Software All Rights Reserved

Copyright © 2010 Mia-Software All Rights Reserved

E4Plug-in

3.xPlug-in

Com

patib

ility

La

yer

Refactoring

Runs Eclipse 3.x plug-ins into E4

Strategy #1: Generate an E4 Plug-in from a 3.x Plug-inProblem:

The new plug-in can’t run in 3.x => 2 plug-ins to maintain

Strategy #2: Use the backward compatibility layerProblem:

The compatibility layer doesn’t support all the existing plug-ins

A solution :Refactor the E3 plug-in for the backward compatibility layer

3.x

Page 15: Mia-Software at Eclipse Modeling Symposium 2010

Copyright © 2010 Mia-Software All Rights Reserved

Copyright © 2010 Mia-Software All Rights Reserved

Refactoring

Example:To be visible in E4, menus must be explicitly created by an ActionProvider

• Java source code=> New ActionProvider subclass to create the menu

• Plugin.xml=> New extension (org.eclipse.ui.navigator.navigatorContent )

• MANIFEST.MF=> New required bundle (org.eclipse.ui.navigator)

TransformedPlug-in

ExistingPlug-in

Model of the existing

Plug-in

Model of the migrated

Plug-in

The transformed plug-in still runs in E3 The menus are now visible in E4

Page 16: Mia-Software at Eclipse Modeling Symposium 2010

Copyright © 2010 Mia-Software All Rights Reserved

Copyright © 2010 Mia-Software All Rights Reserved

Information Mining

Initialize B3 models

B3 Model(build configuration)

Plug-ins to build

Model of plugins to build

Team information(CVS, SVN, etc)

Update sites(p2)

Model of update sites content

Resolved plug-insdependencies

Build resolution strategies(constraints solver)

Cartography

IDM++ Research Project (ANR) -> Sept 2011

Page 17: Mia-Software at Eclipse Modeling Symposium 2010

Copyright © 2010 Mia-Software All Rights Reserved

Copyright © 2010 Mia-Software All Rights Reserved

Thank you !

Eclipse projects

http://www.eclipse.org/MoDisco/

http://www.eclipse.org/modeling/emft/facet/

Company

http://www.mia-software.com/

http://www.sodifrance.fr/

Blog

http://fmadiot.blogspot.com/