Using RCP Views to view UML Diagrams ?

Who doesn’t know this:
You as Software Architect have listen to your business users requirements and designed such great UML diagrams – and now you present them proudly – but your business users don’t understand what you designed. They couldn’t imagine what all those dependencies, relations, inheritance, 0..1, 0..* mean.
What if you could generate by-magic RCP views directly from your UML model ?
…and your business users can understand what your diagrams mean and also see those little hidden secrets from properties like “length of a String” causing the RCP View to show a single line or multi-line text field ?
…or showing fields marked as index as required with yellow background ?
…or showing your Enumerations as SingleChoices or Combos ?
Utopia ?
No – this is the way to realize it:
use openArchitectureWare to generate from your UML Model Java Code, Configuration Files, EMF Models and more
use redView to auto-magically generate dynamic Views from your EMF Models
(Hint: the first 3 TabItems represent 0..1 or 1..1 associations, the last two TabItems contain a Table and represent 0..* or 1..* associations)
Curious ?
Then visit on Thursday at 2:30pm Room 206 Session
redView is a part of a complex enterprise solution – if you want to know more about my OSGI – Equinox – Riena – Easybeans Serverproject please visit JAX09 in Germany and book the OSGI ExpertsDay.
ekke
blog in german

16 responses

  1. This is very cool.

    Amazingly, less than two weeks ago I presented a prototype of a similar application (which I called The Animator) to a Brazilian Java user group.

    The key difference is that there is no need for code generation – the application takes an UML model as input and dynamically renders a SWT/JFace UI.

  2. Rafael,

    the redView project will be published as open source first week of may. redView itself doesnt need an UML model or generation – it can also be used to create UI from scratch.
    Using a generation framework like openArchitectureWare gives you much flexibility how your UML model will be “interpreted” to generate the EMF UI model.

    ekke

  3. So if I understand correct: RedView comes with a RedView metamodel, and the oAW generator generates a RedView model from your domain EMF model or UML model (similar to the genmodel in EMF, or gmfgen in GMF).
    Then the user has the ability to “modify” this RedView model instance, and on the second step the code generator generates the RCP views with the Riena Ridgets for you.

    Are my assumptions correct😉, or got I something wrong?!

    Cheers,
    Matthias

  4. mattre,
    you’re correct:
    redView has an EMF MetaModel for SWT:
    elements, layout, databinding, styles etc.
    the oAW generator generates redView (EMF) model from my domain (UML) model.
    the user can modify the redView models – and those modifications are stored in the redView (EMF) model.

    the second step isn’t nessecary: redView isn’t only a WYSIWYG SWT (Riena) View editor – there’s also a factory where you get a composite DYNAMICALLY rendered by redView.
    only if you dont like dynamic behaviour then you can use oAW to generate code for RCP Views with Riena Ridgets

  5. I like the WYSIWYG editor idea (I might have already known when looking at the screenshot) and also that you can dynamically render any EMF model.

    I am really looking forward to the source code… I hope you make it public soon ;)!!

    Cheers!

  6. mattre,
    we expect to publish redView first week of may.
    if you’re at JAX09 in Mainz – I’ll also show other parts at OSGI Experts Day.
    ekke

  7. Ekke, i eagerly await the release of this project. Wondering if the concept could be ported to generate UI for other frameworks. I work with Flex and I’m hoping it might be possible to apply your concepts to generating Flex UI dynamically.

    -john

  8. john,
    for future releases we’re thinking about this.
    at the moment Flo ( the developer of the designer-editor ) is fighting against different behavior under Vista, Carbon, Cocoa…
    …but still hoping to publish this month
    ekke

    • It is my understanding that use of Ridgets is what enables the creation of models representing the UI. By having the Ridget API abstract many of the complexities of using Widgets directly it becomes possible to model key features. I am thinking in order to use Flex a similar “Flidget” API would be needed – would this be reasonable assumption?

      • re-reading the thread posts…i see that Ridgets are not a pre-requisite for the modeling – I guess what is needed is an EMF Flex Metamodel that would be equivalent of the SWT Metamodel

      • Hi john,

        basically redview is divided into 2 parts. A ui independent part and a ui part.

        1)
        Simplified the “independent part” is also divided into 2 parts. (A model connector and abstract ui controllers.) The important thing is, that this part does not know anything about the ui technology used like swt,…
        This part knows the high level semantic of the metamodel. It deals with elements, forms, entries, items, styles, layouts,… as controllers and their relations on an abstract level. It knows all that is required to create a dynamic ui.
        It also handles the emf model changes. Each notification is passed to the abstract controller.

        2)
        The ui part is responsible for creating the gui. Currently we use a swtUi based on riena. Riena offers a lot of very usefull features.
        To create the dynamic ui i have been implementing specific controller for each swt element. The abstract controller delegate their calls to the specific ui controller, which create the ui.
        This part should be completely plugable. But actually not in our first release i think. Then the redview metamodel will offer only the base semantics mentioned above and will be extendable by the “emf child creation extender”. So far the validators and converters are extendable. The other metamodel will follow. But not sure when.

        Designer)
        Additionally there is a designerEditor which allows designing the ui by drag and drop, changing all properties of the model (so far they are editable),… Each change made by the designer cause a emfEditCommand, which changes the model. This changeNotfication is passed to the abstract controller, which delegates to the specific controller, which forces the ui change.

        Your question, whether redview can be used to create flex ui’s. Actually i am not common with flex. I tried to find out a bit before writing this thread. I think flex uses a mxml-file which is interpreted by the flash player. Right?
        I could imagine the following, but am not so sure about it at the moment. It would be possible to implement a ui part (2) which processes all the modelNotifications. The ui controller can implement a feature which allows you to get the mxml-file described by the current state of the “flex” model, which was built by the ui controller (2). If the model changes, the flash player will become notified an refreshes the mxml.
        But i am not familar with flex and i have no idea how a designer could be implemented? But it would be enough to send emfEditCommands to the model. These notifications would change the flex model by passing the notification to the ui controller (2).

        If you have questions, feel free to ask…😉

        Greetings, Flo

  9. >>I think flex uses a mxml-file which is interpreted by the flash player. Right?
    Yes mxml file is source which will be compiled to .swf and served to client.

    >>If the model changes, the flash player will become notified an refreshes the mxml.
    This doesn’t have to be real time – changes now require a build – to compile the swf

    >>Flex has an editor based on Eclipse called FlexBuilder – I might be able to find a way to sense changes

    I am guessing some component is going to have to be able to parse mxml into some kinda of AST so it can be converted into EMF – emf to mxml should be just a matter or parsing the model and applying Xpand??

    At this stage I am open to any ideas – I am still learning the Eclipse modeling tools. Maybe when your source code is released i will be able to see what your talking about.

    I like your vision. Somebody has to start working on UI generation from EMF – Your efforts are appreciated – I hope to be able to contribute at some point. We seem to have similar goals.

    Thanks for replying. Looking forward to seeing some code (it doesn’t need to be release quality – i just would like to start looking at the API)

    -john

  10. hi john,

    >>Flex has an editor based on Eclipse called FlexBuilder – I might be able to find a way to sense changes
    Sounds great…

    >>I am guessing some component is going to have to be able to parse mxml into some kinda of AST so it can be converted
    >>into EMF – emf to mxml should be just a matter or parsing the model and applying Xpand??
    If i understand it well, there should be componentes which create an emf model from a given mxml. Maybe xText would be helpful. You could create a “mxml language” there. If the language is defined, xText parses the mxml to emf.

    >>I like your vision. Somebody has to start working on UI generation from EMF – Your efforts are appreciated – I hope to
    >>be able to contribute at some point. We seem to have similar goals.
    Currently redview does not generate any kind of ui code. It uses the redviewmodel (an emf model) to render the ui in realtime. So any changes applied to the model are directly reflected to the ui. So there are no generation steps required. This model can be stored and on loading it, the ui is directly rendered.
    But we also thought about the possiblity to generate ui code. Of course, the created redviewModel as an emfModel can be used to generate any kind of ui code using oaw.

    Greetings, Flo

  11. Hi Flo,

    >>If i understand it well, there should be componentes which create an emf model from a given mxml. Maybe xText would be helpful. You could create a “mxml language” there. If the >>language is defined, xText parses the mxml to emf.

    XText for parsing mxml — hmmmm…. interesting🙂 I know it can parse DSLs created specifically for XText but didn’t think about it for parsing .mxml. I was thinking Antlr but I will look into XText – I am working with it now with a custom DSL i have created to generate Flex artifacts. I was under mindset that XText only worked with grammars defined specifically for XText but this might be allot easier than resorting to Antlr.

    >> But we also thought about the possiblity to generate ui code. Of course, the created redviewModel as an emfModel can be used to generate any kind of ui code using oaw.

    I thought code was generated — that is what i thought could be applied to Flex. Thanks for you ideas will do more research on parsing the mxml and get back to you

    Have a great day,

    John

  12. John,
    the code CAN be generated, but must not.
    our default is the dynamic generation at runtime.
    but: the complete view is an EMF model, so you can of course generate the code from there.
    later on we’ll also provide a generated static version, buit at the moment its dynamic.
    ekke

  13. Ekke,

    I understand that dynamic is your vision. Even though i am currently focused code generation and static, I think i can learn allot from how you use EMF to model the UI. I am an OAW / Xtext beginner so its good to see how other people like yourself are using it.

    -john

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: