Here’s an example of what can be done with Emfatic and EuGENia. The following annotated Ecore metamodel can be used to create a nice Statechart graphical editor.
Here’s the emfatic source:
@namespace(
uri="http://www.cs.toronto.edu",
prefix="statechart")
package statechart;
@gmf.diagram(model.extension="sm", diagram.extension="smd")
class StateMachine{
val State[*] states;
val Transition[*] transitions;
}
abstract class State {
ref NormalState[0..1]#submachine parentState;
}
@gmf.node(label="name", label.icon="false", figure="rounded", border.color="0,0,0")
class NormalState extends State{
attr String[1] name;
@gmf.compartment(collapsible="true")
val State[*]#parentState submachine;
}
@gmf.node(label="name", label.icon="false", figure="ellipse", color="0,0,0", border.color="0,0,0", size="1,1")
class InitialState extends State{
attr String[1] name="start";
}
@gmf.node(label="name", label.icon="false", figure="rectangle", color="0,0,0", border.color="0,0,0", size="1,1")
class FinalState extends State{
attr String[1] name="end";
}
@gmf.link(label="name", source="start", target="end", target.decoration="arrow", color="0,0,0")
class Transition{
attr String[1] name;
ref State[1] start;
ref State[1] end;
}
The diagram of the resulting Ecore model is (click to enlarge):
And once EuGENia has done its magic (instructions here), the resulting editor looks like this (again, click to enlarge):
Moreover, we can add EVL constraints to the metamodel and validate the resulting models according to them. This is a fairly simple example, but it goes a long way to demonstrate how easy it is to create things like this.
Filed under: diagrams, eclipse, fun, modeling | 3 Comments
Tags: EMF, Epsilon, EuGENia, GMF, Statecharts
I just read on Ian Skerrett’s blog that the Eclipse Foundation announced the organisation of Eclipse Modeling Days in New York City and Toronto. In Toronto, it will happen on Wednesday, November 18 in IBM’s Toronto Lab in Markham.
According to the press release:
This day-long event is your opportunity to learn about the Eclipse Modeling projects and understand how they can help your organization adopt a model driven development approach.
Some of the abstracts for the sessions can be found here.
Attendance is free but people must register. You can find more information about how to register, as well as about the agenda of the event on the relevant Eclipse wiki page.
Filed under: eclipse, events, modeling | 2 Comments
Tags: Eclipse Modeling Day
Working towards my MSc thesis, I’m increasingly engaging with the Model Management Tool Framework (MMTF), an Eclipse-based tool framework for software model management, built by Rick Salay. At a glance, MMTF allows users to create macromodels (very roughly speaking, models that have other models as elements) in the form of “model interconnection diagrams” (MIDs). The elements of a MID are models of various types that are connected by model mappings (model mappings are models that describe how some other models are related).
As mentioned, the nodes/models in a MID are typed. For example, if we employ a MID to show how a particular UML class diagram is related to a particular UML sequence diagram, it would contain a node of type “UML class diagram” and a node of type “UML sequence diagram” and a mapping link between them (let’s not go into mapping types here). MMTF, being a framework, offers a way for users to plug in their own model types.
MMTF is built on top of the Eclipse line of model-related technologies (EMF, GMF, GEF etc). Therefore the notion of plugging in a new model type in practice means creating a new metamodel (using EMF), creating a graphical diagram editor for it (using GMF) and then plugging it in MMTF as an Eclipse plugin. Such model types, that require a new full-blown GMF graphical editor are called “heavy”, in contrast to “light model types”. Light types are what Qiyu Zhu spent this summer implementing. The idea is that heavy types already registered with MMTF (we already have for example good support for state machine models) can be constrained (presently using only OCL) to create useful model subtypes.
As GMF is not an easy monster to fight against, light model types are a very good step for MMTF. But useful as they are, heavy types still remain at the core, so anything that makes playing with GMF easier, is very good news indeed. I was therefore delighted to stumble upon EuGENia!
EuGENia, coupled with Emfatic can dramatically speed the creation of heavy model types. The user needs to create an ecore model using the simple DSL employed by Emfatic and then properly annotate it with GMF-related information. EuGENia then takes over the task of generating all the ugly GMF stuff. This might sound like a bunch, but compared to the plunging oneself into the dungeons of GMF, fighting graphical definition model dragons, mapping model balrogs and generator model orcs, EuGENia makes quite a pleasant journey!
In fact, EuGENia is part of a larger project, Epsilon, which in turn is part of the larger Generative Modeling Technologies research incubator project of Eclipse. Epsilon also has other interesting features apart from EuGENia, such as supporting model transformation, validation and merging.
Filed under: MMTF, modeling | Leave a Comment
Tags: EMF, Epsilon, EuGENia, GMF
Obvious truths for engineers.
One of the things I did during my vacation in Greece, was to attend my graduation ceremony and formally get my diploma from the NTUA. As a graduation gift, my father, an engineer himself (trained electrical-turned software), gave me Fred Brooks’ The Mythical Man-Month, an altogether fitting gift for any young engineer.
On the first page of the book, my father scribbled two pieces of common wisdom, which I want to share here. Here’s an English-language version of what he wrote:
Michalis,
Now that you became an engineer, remember:
- A task can be done
- well
- fast
- cheaply
And of these three, you can only pick two at a time.
- For everyday usage, the transcendental number pi is just 3.14.
May your years be beautiful and creative.
Obvious truths but, as is also the case of most of the things Brooks mentions in the Mythical Man-Month, people tend to overlook them. (No, people don’t forget that pi is 3.14, that reference is obviously an allusion to the KISS principle.)
Thanks dad.
Filed under: blogging, self-reference, software engineering | 1 Comment

