# Emfatic 0.0.2 Release Note

by Chris Daly (cjdaly@us.ibm.com)
Copyright IBM Corp. 2004
The 0.0.2 release of Emfatic introduces several small changes in the area of annotations and datatypes. The intent of the changes is to fix problems with the mapping between Emfatic and Ecore and to bring the Emfatic annotation syntax closer in line with that of Java 1.5 annotations.

### 1. Changes to Annotations

Following are examples that explain the use of annotations in Emfatic 0.0.2 and the changes from the 0.0.1 release.
In the example below, the text ann is used as the source value twice in the context of a single element. Previously Emfatic made an attempt to combine multiple annotations with the same source value into a single annotation. However Ecore allows multiple annotations of a model element to use the same source value. So the Emfatic 0.0.1 mapping failed to allow Ecore models with this pattern of annotation use to be created. With 0.0.2, the code below will produce two annotations, both with source set to ann, for the class in the model.

package p; @ann(k="v") @ann(k="v2") class C { }

Another problem with Emfatic 0.0.1 caused annotation details to be written in a different order than their actual order in the Ecore model.

package p; @ann(k1="v1", k2="v2", k3="v3") class C { }

The example above shows an annotation with 3 key/value detail pairs. Generating Ecore from this and then generating Emfatic from the Ecore could result in the annotation details appearing in a different order. With Emfatic 0.0.2 you will be able to go from Emfatic to Ecore and from Ecore back to Emfatic and the order of details in an annotation (as well as the order of annotations on an element) will be preserved.
Finally, Emfatic 0.0.2 allows a form of annotation similar to the Java 1.5 annotation style where a value is indicated, but the key is not named. It should be as simple as omitting the key, like this:

package p; @ann("hello") class C { }

However the above code will produce a warning. To properly use this syntax you must declare the names of any "implicit" annotation keys using the EmfaticAnnotationMap. The EmfaticAnnotationMap was introduced for Emfatic 0.0.1 as a way to replace long source URIs with short labels in Emfatic code. Now the form of EmfaticAnnotationMap usage has been modified slightly to allow implicit key names to be defined as well. The example below shows how to create a label called "ann" with an implicit key named "key" mapped to the source URI "http://ann-uri".

@EmfaticAnnotationMap("ann(key)"="http://ann-uri") package p; @ann("hello") // like saying @ann(key="hello") class C { }

Below is another example that shows how model documentation annotations can be simplified by using this style of annotation syntax.

@EmfaticAnnotationMap("doc(documentation)"="http://www.eclipse.org/emf/2002/GenModel") package p; @doc("my model documentation") class C { }

Here is a final example showing how more than one implicit annotation key can be defined:

@EmfaticAnnotationMap("ann(key)"="http://ann-URI") @EmfaticAnnotationMap("ann(a,b)"="http://ann-URI") package p; @ann("hello") @ann("X", "Y") class C { }

### 2. Fix for Serializable Datatypes

The following example shows how the transient modifier can be used to change the value of the EDataType serializable attribute from the default of true to false.

package p; datatype d1 : x; transient datatype d2 : x;

In the 0.0.1 release, the default for serializable and the meaning of transient were both incorrect. This has been fix for the 0.0.2 release.