OpenPonk is a free and open source experimental (meta)modeling platform built in the Pharo live environment aiming to create a live, programmable modeling platform for both serious work and fooling around.
The best way to explain this idea is to look at why we started OpenPonk and what we seek from it.
Why we started OpenPonk
OpenPonk was born in Centre for Conceptual Modelling (CCMi) at Faculty of Information Technology of Czech Technical University in Prague. CCMi is a research group concerned with conceptual modeling and the associated challenges. We are interested in designing, advancing, and utilizing models and notations; both mainstream ones (e.g. UML, BPMN), but more importantly domain-specific ones used in specialized environments.
This practically means that we often need a “poweruser” approach to (meta)modeling; we need to manipulate models and data in unexpected ways, easily prototype tools, “what-if” ideas, and generally have different perspectives (especially visual). From a tooling perspective, we also want a platform where a user can build easily and cheaply a solid foundation for their specific metamodels. It is not too uncommon for vendors to have half-baked solutions, especially true for non-software vendors. This is not surprising; building good tools is costly and requires extra expertise, that the user might not possess – their expertise lies elsewhere. We want to lower both the cost and the necessary complexity.
OpenPonk (meta)modeling platform
Metamodeling platform
At the moment we do not support ECore, (e/c)MOF, complete UML, or any other metametamodel to express metamodels in. This makes it much harder to add extensive and well-defined metamodels, and we would certainly like to make amendments in this area, however this hasn’t been an a primary concern so far. Existing models that we work with rarely have an explicit metamodel; in most cases the metamodel is inherently expressed in its actual implementation or semi-represented in some exported form, e.g. model saved in a custom XML file that has neither DTD nor schema. And yet we need to be able to work with such metamodels and create tools for them.
From this perspective, the aim of the platform is to reduce the complexity and the work necessary for creating usable modeling tools and editors even for non-systematic metamodels; after all, any object representation (in OO language) has an implicit metamodel and there may be value in visualizing it or managing it.
So practically speaking, at the moment the only way to add metamodels is through manual implementation in code in Pharo (or writing a code generator applicable to your metamodel).
Modeling tools
From the modeling tool perspective, we have several metamodels, notations, and operations in various stages of progress; some of it proof-of-concept, some for our custom needs, some for our business partners.
Namely:
- UML Class Diagrams – mostly for research related to Ontological UML
- Finite-state machine – proof-of-concept and playground for ideas
- Business Objects Relation Models (BORM) – one of our methodologies
- DEMO (enterprise engineering process models), and
- domain-augmented ER models
Plus some other toys to play with, like textual notation for UML Class Diagrams and BORM (both built with PetitParser, which provides a very agile way of creating grammars), with the ability to edit a diagram (and obviously the model behind) with both text and graphical editor at the same time.
Importance of Pharo
We have to talk about the core environment where OpenPonk lives: Pharo; a modern, ever evolving Smalltalk dialect.
To people unfamiliar, Pharo (or Smalltalk in general) is sort of a programming language, IDE, execution environment and operating system rolled into one, where each part is deeply integrated with one another and all at your fingertips.
For a lack of better comparison, in a modern browser you can open console, play with a DOM, maybe execute some hand-written code. Imagine that you can do this with every aspect of the website, the application, the browser itself, and perhaps even parts of the operating system running it (during runtime, of course), in a docker-like execution container. Pharo is that and much more.
But how does this help with modeling?
Pharo makes for a great platform for rapid prototyping thanks to the combination of a dead-simple language (the grandparent of OO languages), powerful metaprogramming capabilities and short feedback loops; hey, you can even write your entire application in a debugger.
Pharo also gives models life, in a sense. As I have mentioned earlier, any software representation is a model, so why treat models like something magical hidden behind layers of abstractions and queryable only via designated languages? Models are just objects, so we are free to look at them directly, manipulate them with regular code, and utilize their raw power.
Both OpenPonk and Pharo are open source and as noted earlier, the code is directly available and modifiable in the environment. This can be quite practical if when the platform itself wouldn’t be sufficient for a certain case; you can just open the appropriate class of OpenPonk (or Pharo) and modify the code live.
What about other tools?
What we are trying to do is hardly a novel idea, with the most relevant alternative being Eclipse and its Graphical Modeling Project. GMP was in fact the initial pick for our needs, and we built our first BORM editor (which is still being used at times). Although successful at first, with advancing needs we found the environment increasingly restrictive. Combined with a steep learning curve for new contributors, layers of abstractions to facilitate all the generic tools and needs, and overall architecture we simply didn’t see it as a good fit for our long-term needs. Information hiding, user hand-holding, and over-engineering are certainly valuable, if you seek a robust solution for end-users. But for a poweruser any non-essential complexity is problematic, or prohibits different use-cases (in part this also relates to Java).
Future plans
Just like any other project, we are limited by resources. We started as two person effort on a greenfield, with most of the codebase still written by me, but we are finally getting some traction. Several students have already finished theses on topics related to OpenPonk, and I am working on a OpenPonk-based modeling solution for one of our partners. Gaining traction also means that I need to invest much more energy into writing docs (as the current state is… not exciting to say the least), ideally in some interactive format.
Short-term perspective is always bound to the needs of a specific case; whether a thesis, or a solution for specific environment.
From mid-term perspective I want to move the platform from its current monolithic-ish and MVC-ish state to a dynamic environment that better accommodates CCMi’s needs. When I started, I was building just another diagramming tool, as that was most familiar to me. But now I am slowly drifting towards a more dynamic environment; I am learning a lot along the way, including learning what I am actually trying to do.
My own interest is in seeking bridges between code and models as a natural extension of one another. Maybe write some code here, generate a bit from model there. Live synchronization between code and models. Visual and text code editing side by side. Natural flow from code to model and back. OpenPonk and Pharo are a great place to explore such ideas and see how modeling can be introduced to everyday programming. As long as people re willingly writing just code, then the cost of modeling is too high.
Further reading
- a short 5-minute video showing some of the current capabilities of OpenPonk: https://www.youtube.com/watch?v=_gQgXdJyr-0
- a paper describing some technical and architectural aspects published at IWST16: http://www.esug.org/data/ESUG2016/IWST/Papers/IWST_2016_paper_25.pdf.
- OpenPonk website & download: openponk.github.io.
I am a master’s student at Faculty of Information Technology at Czech Technical University in Prague, and a member of the CCMi research group. My interest is in combining programming and modeling aspects of engineering mostly in Pharo live environment.
this is great!
Peter, I sent you mail, as our projects have a lot in common
Could you also briefly describe your projects here? At least to provide some pointers since readers won’t be able to read the email you sent to Peter 🙂
Jodi
Jordi, I think that I will just paste my mail to Peter here, so we can have this discussion public
~
Hi Peter
Radek from Warsaw here. I just read your post@modelling languages. And watched OpenPhonk demo@yt.
I’m impressed. Congratulations for making such a great thing!
Most impressing part was when you typed in the DSL and the “accept order” poped up in the diagram.
So… our projects have a lot in common. Honestly I think that there is less differences than similarities, so I will sum up the differences. Hope you are interested.
– MinusZero is based on extended graph model (my own math invention) that allows to express meta meta models / meta models / instances in the same mathematical structure. thus all the query / imperative construction tools can be used on any level. this is very simple. yet powerfull
– in MinusZero you can define any meta meta / meta model today. Plus you can easily define and customize its graphical representation
– there is graph query / creation language build in. now it is extended to be full blown object imperative language (same as in OpenPhonk it can be represented as diagram or as code or as both. I plan to not have “update dsl from diagram” button, but to do it automatically)
– the imperative language is quite open and have some interesting qualities like its keywords inheritance 🙂 this is quite natural in this new class of languages
– currently there is meta meta model and diagram representation defined for uml class / state machine / and the imperative language constructs
– MinusZero is c#/wpf althought I quite like pharo 🙂
the rest is pretty the same. minuszero is opensource, but only me and my wife knows about it as I had not told anyone 🙂
I have a question to you: in the “code first” scenario, how do you layout diagrams to be usefull? I have been working as data architect in very big business domains (for example 3K classes) and ended up with “it is impossible to have good automatic diagramming layout”, so I was not planning to have any automatic layout mechanism to be build in. But I might be wrong….
~
MinusZero is https://github.com/rad9k/MinusZero but this is some old version and much in progress one. I’m preparing new release, with proper web site and you tube videos
Hi Radek
To answer your DSL notes:
right now updating the text is indeed with a click of a button, but automating that should be easy in both ways, although I don’t know what is the performance of “large text -> model” if done on every keystroke.
As for layouting… that is indeed a complex problem. It is a lot about knowing what to apply, where, and why, and not expecting miracles. 🙂 E.g. the only info you can get from layouting 3k classes is clustering, for which you can use force-based layouting and maybe subgraph condensation to see dependencies. In practice you work with smaller subset (otherwise you would overwhelm yourself), for which there’s a lot of different more-or-less successful layouting algorithms (including graphviz ones)… I studied this area in my bachelor’s thesis ( https://dspace.cvut.cz/bitstream/handle/10467/63194/F8-BP-2016-Uhnak-Peter-thesis.pdf?sequence=1&isAllowed=y ; DynaCASE was an old name of OpenPonk), however with rather mixed results, so there is a lot of work to be done.
So automatic layouting will not give you public-presentation-ready diagrams for any larger models without further fiddling, but it can be good enough during development. This is what PlantUML does too, (and I fiddle with the layout there too). My recommendation to start is to convert your diagram to GraphViz’s format, run it through GV and extract the position information.
Peter
Thanks for sharing it Radek (and ping me back once minuszero is ready)
Yes, the performance might be an issue…. I treat my work as research and try not to optimize much. In fact sometimes I even stop myself from optimizing as for some cases I even do not know what will be most popular use case to optimize for…
For textdiagram translation I have additional problem – I can not recreate the diagram (in fact this is just graph under) from scratch, whenever there is change in text. This is due the fact, that there could be external references (incoming edges) from some other distant part of the graph. And if I recreate the graph from text I would create new vertexes and loose the references. I think I could find some heuristic to solve this…
as for the GV – is it supporting different vertex sizes? for example class box can have a big list of attributes or no attributes at all – so we have different sizes of the box. is it supported?
and last one from me: how long (in man years) it took to develop openponk?
External references will indeed break if full text replacement is done; but if done keypress by keypress then it might easier to track what model elements are being changed?
Yes in GV you can specify what shapes and sizes you want each element to be. OpenPonk started something over 2.5 years ago, however I’ve been full-time student the whole time plus I also had part-time job for the first 1.5 years… so I don’t know to what “full-time development” would it compare.
OpenPonk is a great tool and we are working with Peter and Robert team in order to built a graphic editor for epidemiological models in the context of the Kendrick DSL: http://ummisco.github.io/kendrick/
Great work Peter! Thanks for sharing it.
This is a nice use-case of the power of Pharo environment. As someone who’s area of research is language engineering with emphasis on DSLs and (meta)modeling OpenPonk will surely be a good motivation to take a closer look at ecosystem around Pharo.
Yes this is a definitively a great work and will help people adopt Pharo for DSLS and meta-modeling stuff
Thanks Igor! Pharo is indeed a great ecosystem and we want to make it even better for such tasks. 🙂