Generation Gap Pattern Tooling
EMF Loophole is a tool that hooks into the EMF codegen and helps you implement the generation gap pattern. This pattern is about separating generated code and the handwritten one in two separate classes, the handwritten one inheriting from the generated one.
This project is based on the ideas described in a blog post by Heiko Behrens (http://heikobehrens.net/2009/04/23/generation-gap-pattern/) and a basic implementation in MWE 2 (http://download.eclipse.org/modeling/emft/mwe/javadoc/2.3/org/eclipse/emf/mwe2/ecore/EcoreGenerator.html)
EMF Loophole is released in several versions, one for each EMF version. The following Eclipse p2 repository (update-site) in your update manager (in Eclipse, Help Menu > Install New Software...
, Add...
button on the top right corner) provides all releases for all versions:
http://mbarbero.github.io/emf-loophole/
The releases for each EMF version can be a accessed with the following URLs:
- http://mbarbero.github.io/emf-loophole/2.5/ for EMF 2.5
- http://mbarbero.github.io/emf-loophole/2.6/ for EMF 2.6
- http://mbarbero.github.io/emf-loophole/2.7/ for EMF 2.7
- http://mbarbero.github.io/emf-loophole/2.8/ for EMF 2.8
- http://mbarbero.github.io/emf-loophole/2.9/ for EMF 2.9
Then, select the “EMF Loophole” feature suitable for you and click on Finish
.
- Java SE 5
- Eclipse 3.5+ (Galileo)
- File > New > Eclipse Modeling Framework > Loophole Generator model
- Click Next, then select the Generator model (.genmodel) file you want to reference (if a genmodel file was selected before launching the wizard, it has already been set to this one)
- Click Finish
- customClassNamePattern Pattern for deriving custom implementation and item provider names from model element names (“{0}CustomImpl” by default)
- generateCustomClasses Whether all custom implementation classes should be generated
- customModelDirectory The target directory for custom model code
- cleanModelDirectory Whether the source folder containing generated model classes should be cleaned
- generateCustomProviders Whether all custom item providers should be generated
- customEditDirectory The target directory for custom edit code
- cleanEditDirectory Whether the source folder containing generated item provider should be cleaned
- customClassPackageSuffix The suffix of the package for custom model class
- customProviderPackageSuffix The suffix of the package for custom item providers
It is not possible to reference a Loophole Generator (.gengapmodel) model from another one. Then it is not possible to create customized Ecore models that reference each others.
Go to org.eclipselabs.emf.loophole-parent
and do a mvn clean package
.
Clone this repository, import all projects in your Eclipse and set your target platform to the one in org.eclipselabs.emf.loophole-parent/targetPlatforms
.
Copyright © 2013 Obeo. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html