Bidirectional M2M Transformations using Eclipse EMF - eclipse-emf

I would like to do bidirectional Model2Model transformations. Both models are EMF / eCore based. Actually I would prefer that one model is an editable view on the other.
What are my options?
Which tools and tranformation languages are avaiable and what are their restrictions?

M2M are the hardest. Industries strength tools are rare, lots of academia stuff. If you're dead set on a M2M language, look into ATL which should also support ecore. Otherwise you can look at Xtend, which was made for model to text but you can abuse it and it should be more comftable than plain java. If your into research look at Scala based transformations here
http://metrikforge.informatik.hu-berlin.de/attachments/download/193/george_wider_scheidgen_ICMT_2012.pdf

There are more transformation tools than you can imagine for EMF, its kind of crazy...
For metamodel to metamodel transformation where the models are not very similar:
ATL is probably the most popular and most "baked"
Epsilon project has the Epsilon Transformation Language.
If the metamodels are very similar and you only need to tweak some things then there are tools targeted that type of migration/updating:
ATL now has a refining mode
Epsilon has Flock
Edapt looks very interesting as well because it does the metamodel/model changes together. It lets you work on a tree view and comes with a set prebuilt set of rules.
Henshin which lets you operate on a diagram view of the model
EMF Refactor is a more code-level approach, that can also use Henshin rules somehow.
You can always directly manipulate the metamodel and model using the EMF Java APIs as well.
I'll add, if you are doing any real EMF work you will need to get and read EMF: Eclipse Modeling Framework. It's available in Safari also. I highly recommend Safari, for $39 a month you get almost every development ebook you could ever use.

If you insist on doing bidirectional M2M transformations, (so-called Bxs), then know that there is an active researcher's community updating that wiki : http://bx-community.wikidot.com.
If you visit it, you will find that they list a bunch of tool suitable for Bx transformations http://bx-community.wikidot.com/relatedtools.
I used ECHO in the past which provides an implementation of QVT-R based on the KodKod constraints solver.
It's definitely worth giving it a try.

Since you specifically asked for bi-directional model transformations, I must say that you have no options. To make it claer, adding to the answer you got form Ed Willink, none of the existing M2M transformation languages (AFAIK) supports bi-directional model transformations.
Work on a QVTr and QVTc execution engine is starting to look promising if you are still interested in this: QVTd Project.

Related

Creating and annotating simple geographical maps in Django

I am looking for a simple way to create geographical maps in Django, in which I could then select, highlight and annotate countries or groups thereof.
"Annotate": insert a label displaying textual information about the said country.
Is there anything that comes to mind?
Many thanks
EDIT: I checked GeoDjango already and it looks like much work in order to get where I need to. Don't get me wrong: I'm not trying to minimize my own investment in learning new tools, but for this project, I have a trade-off between time allocated to learning and the relative importance of this geographical feature in my app. It's more of a nice-to-have feature I'd like to add to an already 'complete' app. So I wondered whether there exists a 'simpler' python library for this task.
I think this is more of a question for if there is a front-end library to elegantly handle this. However if you need to generate the maps you could try something like this
https://kartograph.org/
I have personally used this http://jvectormap.com/ and found it to be really good.
In your database you could just have a Countries model with any associated information you might need to display, and create a view to handle that appropriately.

GVNIX and spatial searchs

I have installed this great development tool and I´m testing how can I use spatial queries or customize other functions.
For example, in the petclinic-geo project create a new map that shows only the owners inside Valencia (area). I think there is no roo commands that can create spatial queries.
In this case, how can I create new custom functions ?, Do I need to remove Roo to do that or either codes can coexist?
Thanks
Sorry Allen, Currently this feature is not implemented on framework. But, in gvNIX 2.0 roadmap (current in definition), probably, will includes advanced search for geometrical entities.
Anyway, you could make push-in of generated .aj files to customize the data request used by map component to fit returned data to your requirements.
Good luck!

MVC approach with C++

I have been learning PHP MVC pattern and it is pretty cool. have almost finished app and I can see how mess you can make a code without good design.
Now can MCV be applied to C++ apps? Where does Plugin manager/Plugins go if that is even possible?In model or controller?
Thanks!
EDIT:
I mean C++ with GUI toolkit like QT/Wxwidgets/GTK+
Also Please help me on how to implement in C++. I have learned how to do it in PHP but as you know the two languages are somehow different!
EDIT2
http://forums.wxwidgets.org/viewtopic.php?f=1&t=30983
how do you actually implement it in C++
make classes in charge of rendering know nothing about application details. Call them SomethingView classes to make this point clear
make your domain objects not know anything about visualization or user interaction. You don't need to call them Model, but you could
create a set of classes in charge of running the role of Controllers: wire somehow dependencies to view and model classes via dependency injection if possible. example: CppInject. In any case, controller classes can know both about model and view classes, so the important part is this: all the coupling between view and model objects is isolated to the controllers.
Also, this implies, that all imperative-style programming should be confined to the controller classes as well: view and model should be declarative-style. That means, they should offer services related to its role, but avoid direct interaction with other objects as side-effects
It is not true you need to implement communication between controllers and the other components with event-style system, although such system is definitely helpful, but certainly not required
surprise! the above applies to any language or framework, except of course languages that somehow already force MVC down your throat from the start, i.e: ruby on rails
MVC is a design pattern not a language specific construct, So yes you can apply it to C++ app as well.
MVC can and should be applied in any language so your User Interface is loosely coupled with the backend & either can be changed with minimum impact on each other.
The MVC pattern provides a clean separation of objects into:
Models for maintaining data,
Views for displaying all or a portion of the data, and
Controllers for handling events that affect the model or view(s).
Yes, MVC can be applied in C++. For example, the MFC framework uses Document/View architecture which is essentially an MVC.
A design pattern isn't a library or class. It's a pattern. So you don't have a generic MVC library for C++.
Use Tree frogs Framework. TreeFrog Framework is a high-speed and full-stack C++ framework for developing Web applications.
MVC is an architectural design pattern (i.e. a way of building software) commonly associated with web applications, but it is applicable in general to any software project in any language. You have to make a little abstraction effort on your project, and identify which piece of software belongs to each part (i.e. a GUI is probably part of View, etc.).
Note that this type of pattern is mainly aimed to separate developement, so that any part of the project can be developed regardless of the others. This can be annoying for a small standalone application, but useful and rewarding on bigger projects.
Personally, I use boost state machines for the logical and boost signals to connect things together.
I wrote a little example that you can analyze here:
https://github.com/edubois/mvp-player

ColdFusion CRUD

For quite a long time now, I've been trying to write and have been in search of "a really good" CRUD application. Don't get me wrong - I didn't say "The ultimate" CRUD application. Just one that could be rated 1st class.
What I'm saying is: Please don't respond to this plea with an answer like "Well, every situation is different..."
Q: Is there a blog post or something in the Adobe documentation that shows CRUD on a one-to-many relationship (Header/Detail), that uses web standards css (instead of tables), that uses best practices (CF9 has changed so many things now: scripted components, ORM), that uses the latest UI techniques (jQuery or some of the built-in AJAX features of CF9), that has a nice front-end (a nice looking header and background along with some pretty buttons)?
I know that's a lot to ask, but such is my quest.
A good example of a one-to-many relationship is the city/state xml files built into the Spry examples. There are 23,000 cities in the sample xml files, so I think that's better than just using random data.
I'm not really sure what you're asking, but I just want to respond to a couple of points in your question (this is more a comment than an answer, but since SO is stupidly limited in this, I'll put it here instead.)
that uses web standards css (instead of tables),
There is no "css instead of tables" - they are two distinct and compatible things!
CSS describes visual aspects of a document, whilst tables markup tabular data.
If you're displaying tabular data, then tables is exactly what you should be using, and you can use CSS to make it look more exciting than the plain styles that tables come in.
Since you're asking for a CRUD app, odds are you are going to be wanting to display tabular data so should be using tables.
(The common mistake people make is not understanding the nature of the web, and using tables to apply grid layouts to documents, when they should be using strucuted semantic markup instead.)
that uses best practices (CF9 has changed so many things now:
scripted components, ORM)
Scripted components are not a best practise!
They are an alternative syntax (for people that prefer having non-descriptive braces everywhere) they do not offer anything you can't already do.
i would strongly suggest you check out cfwheels. read the documentation, it's built for doing such crud applications and has an amazing set of features and will save you a lot of time. as for the interface, there are many jquery plugins out there that can handle this. i suggest looking at ajaxrain and find a plugin you like

What is the ultimate program to make a drawing of a database model? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
One of the first things I do when I'm on a new project is design a database model. To visualize the model I use a 7 year old version of Smartdraw. Maybe it's time for something new. What is the ultimate program to make a drawing of a database model. Smartdraw is for Windows only. Is there something that can be used on unix as well?
The best tool is pencil and paper.
Perhaps not the answer you are looking for, but sometimes the most simple solution is the best. :-)
A whiteboard (and camera to take a picture afterwards)
Your brain is the best drawing tool.
I prefer to develop a database schema in a simple text file.
At first it contains just the table names, attributes and foreign keys:
company:
company_name
...
employee:
name
age
company_name -> company
...
...:
The syntax is not important.
It just needs to be clearly arranged and easy to change.
Later I add types and CHECK() constraints,
so the text file gradually transforms into valid SQL code.
Using a drawing tool in that early stage is just distracting,
because it encourages to waste your time with moving reactangles.
Instead, let your brain build a picture of the schema
in the same way it creates fantasy pictures while reading a book.
As the schema grows,
it becomes necessary to support the brain by creating an overview.
Here, however, pencil and paper are faster than any drawing software.
Also note that there is no need to clutter an overview with unimportant details.
Just sketch the table names and the most important relationships (foreign keys).
Any further details will decrease the value of this overview.
However, if you really feel more comfortable with extremely detailed graphics than with text files and overview graphics, you might want to try
DBDesigner4
or
WWW SQL Designer.
I'm happy using Sybase PowerDesigner for years now.
Did you take a look at Visio 2007 SQL Server Add-In?
You can find it here: http://dbalink.wordpress.com/2008/04/24/microsoft-office-visio-2007-professional-sql-server-add-in/
WWW SQL Designer is one of the best that I've seen, which is pretty amazing since it is all javascript. It can also import and export xml and sql code of everything you draw. And they've added nifty bezier curves since I last used it.
I don't know if it's the "ultimate" program for drawing database models, but I use Visio. Unfortunately, it only runs in Windows.
On the upside, I can create my own shapes, or modify existing ones, and save them in collections called stencils. I can also make my shapes "smart" by programming them to do various things when I double click on them.
I use a whiteboard and a camera as well. I second the pencil and paper. I keep a pen(cil) and pad of paper with me almost always because I am forever designing something in my head and need to jot it down. I like Visio as well but my favorite software program to use has always been ERWin. The price of that thing is just way out line, but it is great.
I like ERWin. Not Cheap, but it can reverse engineer or do initial design + generate CRUD and manipulate db structure. Viso is pretty good for this too, but its not as complete and of course as strong MS SQL leanings is capabilities.
I used to use Visio, but if your database server is MySQL, try MySQL Workbench. It has a linux version as well as a win32 version. Like their other GUI products it has its fair share of quirks, but it works quite well and has the ability to create a diagram of a schema and a schema from a diagram.
I also agree that a pencil and paper, or whiteboard and camera is a great way to sketch things out, but I do like the GUI tools for putting down an idea which is a bit more well formed or complicated.
I like to use the open-source mind-mapping program Freemind. It's similar to designing with pencil and paper in that there's not a lot of surface complexity to interrupt the design process.
But it has two huge advantages over paper/pencil:
node folding
easy drag-and-drop re-arranging
It is very easy to navigate the interface without using the mouse within about five minutes. You can add as many or as few details as you like and can always fold up the details to de-clutter your view. Here's a sample screenshot:
The circles at the ends of the Departments, Employees, and Hours tables indicate that there are more nodes that are folded up. You can go crazy with different fonts, background colors, and even HTML formatting. I just did a [Ctrl]-[B] to make my table names Bold.
FreeMind--and mind-mapping software in general--provides its biggest benefit by staying out of the way of the creative process. It's the first tool I turn to when starting a new project from scratch.
NOTE: I've only ever used the program on Windows, but it is available on Linux.
DIA is not bad, and there are tools to actually generate some code from some types of models. If you are using PostgreSQL, there is even a tool for going the other way, pg-autodoc.
DIA is available for Unix, and I believe Windows as well.
I used to use Viso but now, as I'm more Mac based I use Omnigraffle.
I do have to admit though, as andyUK does, I do a rough sketch on paper.
It also depends on what Database you're using. If it's MySQL then there are quite a few visual development tools available, just have a google
There may be more technical programs, but I use SmartDraw. I would also like to note that 'ultimate' is up to your circumstances. Find what works best for you or you and your company. What works for you is the 'ultimate'.
Brainstorm/sketch the database on paper/whiteboard first, and then go with a diagram tool.
Which tool depends on your target database. We use SQL Server and thus the designer in SQL Server Management Studio works great for us, since we create the database itself at the same time.
For linux I use umbrello
If you're looking for a cheap solution/tool without any reverse/forward engineering capabilities, MS Visio might be your best bet. However, if you're planning to invest some money toward ERD tool, spend it on ER/Studio.
I used to use and be champion of ERWIN. As soon as I started to use ER/Studio, I became fan of it. I'm an enterprise data architect at one of the Fortune 100 company and I don't know how to get my work done without it.
PS: I don't have no affiliations with any of those products and companies.
OpenOffice has a vector drawing tool, and Inkscape is a another good one.
Otherwise, you can use Graphviz (dot language) to generate such diagram out of a textual description.
There are also some tools to generate such diagram out of an existing database (I first thought it was what you were asking).
If you don't need much take Dia.
I used Power Designer. It's powerful but rather complex.