I have a need to describe a hierarchical finite state machine in a standard and portable format. Is there a widely-accepted and supported file format that I should use?
I see that the Graphviz DOT language supports sub-graphs that may be referenced by directed edges. (Although rendering connected clusters using Graphviz is a bit of a problem.) Interpreting the text label on a generic directed edge as a transition event/criterion seems like a slight semantic stretch, but not unusable.
I see that a UML Statechart has support for hierarchically nested states. However, the accepted answer to this question implies that describing a statechart in XMI myself may not actually be properly interoperable with tools that nominally support UML.
I see the W3C SCXML Standard. However, this is still a working draft (and has been for almost 7 years), and I'm not certain if any tool supports this format (other than through conversion).
Is there a more widely-acceptable alternative than one of the above? Should I use one or the other of the above?
One of the examples of portability is that I would like for the graph to be able to be read and used by an HSM simulator like Matlab Stateflow.
There is an OMG standard for UML diagram interchange. But I don't thing it is widely accepted. You can also use the eclipse EMF UML2 format, for which you can develop yourself translators for other formats.
Related
I am trying to develop an OWL ontology based on different UML file resources presented in XMI format. Reading through the internet for a while now, it seems that almost all the available tools or approaches are outdated and even when trying some of them they don't provide the expected outcome.
Since this ontology plays a really important role in our project, I wanted to know what is the best approachs/tools to be used in order to convert UML to OWL ?
I have looked into this myself as well and I have found no tools that can do this satisfactory. Problems I ran into were either the tools used an old version of UML, did not support all UML features, used OWL 1 rather than OWL 2 and was supported by only an old version of Protege.
I resorted by doing the translation by hand, which for most UML constructs are not too difficult. For this purpose I have done a write-up on UML vs OWL, which gives an intuitive explanation for why some of the translation is done in a certain why, as well as provide a reference for translating UML to OWL.
There's an OMG spec now available at https://www.omg.org/spec/MOF2RDF/
I haven't yet found an open-source tool implementing this directly (i.e. convert from UML/XMI to OWL/RDF), but there are EMF related activities, that may be relevant (haven't tried), e.g.:
https://github.com/ghillairet/emftriple
You'll probably never get exactly what you want unless you do it by hand, as Henriette mentioned. One viable option is using COGS, which I've found to work pretty well.
The catch is that it's related to Rot's answer by supporting the OMG specification. If it's not much work to make sure that your UML conforms to that specification, it may save some time in the long run. Here's an example of an OWL file produced by COGS.
I want to transform a model (in XMI format) based on the JaMoPP Java 5 metamodel to another model (also in XMI format) based on a basic C++ metamodel that I created using Xtext. After some research, I found two tools for Model To Model transformations: ATL and QVT.
What are the main differences between the two and what are some reasons to use either one instead of the other?
Using/choosing a model transformation language is the same as using a general purpose language (GPL): own preference and background. As with GPLs, some transformation languages will probably fit your programing style better or exhibit better performance for your specific domain. IT might boil down to only the couple that support your modeling technology (e.g. your models are csv files). Additioanly, as opposed to GPLs, modeling languages are quite young and hence an important question atm when picking is tool support and possibly language future developemnt.
On a side note, let me remind you that the QVT specification actually defines three languages: QVTr, QVTc and QVTo.
ATL, QVTr and QVTc are all declarative, while QVTo is imperative (altough ATL allows some mixed descriptions). Other transformation langauges out there can be classified accordignly and should be an important decision point. Also, current tool support for QVTr is limited and unexistent for QVTc. I would recomend reading about them a bit more, perhaps inlcuidng other languages like Epsilon's ETL, Kermeta, etc., and based on your needs make a pick.
I have designed UML diagrams in different tools (StarUML, BoUML, Papyrus, Omondo, Rational Rose, etc.) depending on the project and the date (rose was first, after Omondo, then starUMl, ..., now papyrus). However, I see that I cannot open my old UML diagrams because the tool is obsolete.
I would like to know if there is a standard format for UML diagrams. Probably not in production, but at least to know if there is proposal of standard format.
Probably, Eclipse is doing something like that with the M2 project, but do the other tools (not eclipse based) are interested in reading this format.?
Each UML tool uses its own format, but I think the era of proprietary format is over, and open format for diagrams like this should exist.
I have two answers to this:
In theory the standard exchange format for UML models is XMI but it´s true that each vendor implements a slightly different version so interchange is not a reality. Nevertheless, most tools are converging to at least support the Eclipse MDT-UML2 XMI implementation which in my opinion is becoming de facto XMI standard.
The OMG is working on a new standard : Diagram Definition that is supposed to fix the problems with the current XMI one (they are working a lot with many of the top vendors to make sure that this time they all go in the same direction) and, also important, it will allow to interchange not only the data (i.e. the info about the model elements) but also the layout and graphical representation so that after the import you get a model exactly as the same you exported in the first place
Have you heard of XMI?
#JordiCabot here adds some interesting details about it.
Besides Jordi's reference to the Diagram Definition standardization activity, please note that there is another action ongoing from OMG:
a request for comments has been issued in June 2011 for a CANONICAL XMI format, which is basically a subset and a set of additional rules for writing XMI documents that should limit the possibility of creating different XMI dialects, or at least should allow tools to understand a common dialect (the canonical one).
I'm designing a software component which will get instructions from other components on how the UML diagram should look like, and then will produce this UML diagram in different presentation ways (in SVG, GIF, etc.), for example (in Java):
DiagramDesigner designer = new DiagramDesigner();
designer.setStyle('Use Cases')
designer.addActor('User');
designer.addUseCase('Print Document');
// etc.
String svg = designer.getSvg();
I don't want to re-invent the wheel and want to use some industry-standard language/interface for interconnection between my DiagramDesigner and other components. I'm looking for an interface similar to DOM, but for UML, not for XML.
Can anyone help? Thanks in advance.
ps. Besides the example above I would like to make my diagrams inter-operable and transferrable between servers, e.g.:
// first server
String script = designer.getScript();
// second server
DiagramDesigner desiger2 = DiagramDesigner.import(script);
So if I understand you right, you are looking for a way to work with UML on the metamodel level. You should look at the MOF standard and its implementation the EMF (Eclipse Modeling Framework), which is used by almost all Eclipse based UML tools and this framework is used by many other modeling projects, it even somewhat influenced the standardization of MOF (resulting in SMOF and EMOF split) and therefore I would declare it industry standard.
Probably only loosely related but anyhow: PlantUML. It is open source, built in Java and likely contains already parts of what you want to do.
You can inspire from these scripts to generate any output you want:
http://askuml.com/
Currently examples are given in yUML because they're nice but could be anything.
At least for the syntax part, you could get some inspiration from the large set of textual UML tools (theses tools allow designers to textually specify the model and then they automatically show the model graphically using the standard UML notation).
At least of such tools here: http://modeling-languages.com/content/uml-tools#textual
Does anyone know of any kind of UML variation which can map events in a GUI system?
I have a quite complex event driven GUI system and I would like to create a diagram so new developers can easily get an overview of events fired by various views and what models/controllers or view are instantiated/effected by these events.
I was looking for something that would look more like a mind map which branches all over the place rather than linear scenarios.
Does anyone have any ideas?
Regards,
Chris
State diagrams.
Old and pricey, but here is a great text on modeling user interfaces with state charts. I've worn the pages out on mine....
For quick and dirty message sequence charts, you can't beat the price of mscgen. It uses a source text inspired by the syntax used by AT&T's Graphviz package, which is, incidentally, a good way to rendering arbitrary directed and undirected graphs.
I often use graphviz to document my state machines, as I find it easier to keep in sync with the implementation than a Visio drawing.
the book that finally helped me really understand UML statecharts is Samek's Practical Statecharts in C/C++ which has a few chapters on them as well as an impressive implementation framework for building state-based systems. I think it's worth getting just for the explanations of how to think with statecharts.
For actually creating quick statecharts or similar rough diagrams, I do a lot of work with the textual DOT language in GraphViz and often then include those diagrams directly into documentation generated with doxygen.
UML activity diagrams and state charts can branch all over the place.
See http://www.agilemodeling.com/style/stateChartDiagram.htm
(source: agilemodeling.com)
The communication diagram can lack sequence and it behaves more like a mind map than an activity or sequence diagram. If communicating events is your goal a state chart does show interaction, but rather, well, state. A communication diagram has less on it than an activitystate diagram, though that is not bad either, similar in nature.
You could just leverage UseCases and add keywords or label the uses edge/line. Not recommended if this will be maintained and be more than a pretty picture.
(Image is slightly overloaded, you don't need the numbering and they don't have to be method calls)
(source: agilemodeling.com)
http://www.agilemodeling.com/artifacts/communicationDiagram.htm
Another format which I was reminded of recently is the Dynamic Diagram in the Bon Method. I wrote a posting about it on Artima. The book Seamless Object-Oriented
Software Architecture was made freely available in 2003.
The difference between these and communication diagrams is separation of the steps into a separate legend. That can read like a Use Case by itself, being easy to localise and sometimes to show alternative explanations.
I had great results using this D3 based auto minimum spanning tree implementation. Just pass it a list of graph edges and it'll cluster and draw a UML-like diagram:
https://github.com/cpettitt/dagre-d3
Also great for state diagrams.