Home » Eclipse Projects » Sirius » Is there support for dynamically generated / updated VSMs?
Is there support for dynamically generated / updated VSMs? [message #1701516] |
Mon, 13 July 2015 15:51  |
Eclipse User |
|
|
|
Hi there,
I am working on a problem I have a hierarchy (tree) where any node in the tree could be one of a large number of possible types (>50), each of which is equally valid and possible in this setup; the types of the nodes themselves have their own inheritance structure in which one may derive from another but that's not really important in this scenario. Broadly speaking, there are two types of nodes: internal nodes, which have children, and leaf nodes, which don't. Note that all of the relevant types and objects have been specified using EMF, xCore to be precise.
I'm trying to use Sirius to support the editing (add/delete/change node's parent) of this structure but I'm finding it rather difficult to do so; this is due to the fact that to the best of my understanding, Sirius is static. I'm having to create all the corresponding Sirius nodes, tools and other required things manually, making the initial setup of the hierarchy a serious pain. In addition, the types in the VSM may not always represent the all of the types available, as new ones (including those made by third-parties) are being added relatively frequently. There are also serious maintenance issues around all of the essentially duplicate code for each of the node types I add to Sirius.
I guess I'm wondering if there is a better way to be doing this; is there some support for dynamically generated / updated VSMs in Sirius? If not, is there any plan to add it? Or do I need to come with my own in-house solution to this problem instead?
Thank you very much for your time and I look forward to hearing your response.
- Ryan Schimpel
|
|
|
Re: Is there support for dynamically generated / updated VSMs? [message #1701734 is a reply to message #1701516] |
Wed, 15 July 2015 05:49   |
Eclipse User |
|
|
|
Hello,
As you said even if you have a large number of type, in the end you have
nodes which have children (your internal nodes) or not (leaf nodes).
Therefore, you should have an abstract type that describe this
contaiment in your metamodel. Every type of node inherits from this
abstract type. In your VSM you create a Node (or Container, as you wish)
mapping on this Abstract type where the semantic expression will be how
to access your root node. This Node mapping has a sub node mapping of
the same type but where the semantic expression will be how to acess the
children node.
Later if you want to customize the node display depending on the real
type, you can add conditional style[1] or style customization[2].
Regards,
Steve
[1]
https://www.eclipse.org/sirius/doc/specifier/diagrams/Diagrams.html#conditional_styles
[2]
https://www.eclipse.org/sirius/doc/specifier/diagrams/Diagrams.html#customization
Le 13/07/2015 21:51, Ryan Schimpel a écrit :
> Hi there,
>
> I am working on a problem I have a hierarchy (tree)
> where any node in the tree could be one of a large number of possible
> types (>50), each of which is equally valid and possible in this setup;
> the types of the nodes themselves have their own inheritance structure
> in which one may derive from another but that's not really important in
> this scenario. Broadly speaking, there are two types of nodes: internal
> nodes, which have children, and leaf nodes, which don't. Note that all
> of the relevant types and objects have been specified using EMF, xCore
> to be precise.
>
> I'm trying to use Sirius to support the editing (add/delete/change
> node's parent) of this structure but I'm finding it rather difficult to
> do so; this is due to the fact that to the best of my understanding,
> Sirius is static. I'm having to create all the corresponding Sirius
> nodes, tools and other required things manually, making the initial
> setup of the hierarchy a serious pain. In addition, the types in the
> VSM may not always represent the all of the types available, as new ones
> (including those made by third-parties) are being added relatively
> frequently. There are also serious maintenance issues around all of the
> essentially duplicate code for each of the node types I add to Sirius.
>
> I guess I'm wondering if there is a better way to be doing this; is
> there some support for dynamically generated / updated VSMs in Sirius?
> If not, is there any plan to add it? Or do I need to come with my own
> in-house solution to this problem instead?
>
> Thank you very much for your time and I look forward to hearing your
> response.
>
> - Ryan Schimpel
--
Steve Monnier - Obeo
Need professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
| |
Re: Is there support for dynamically generated / updated VSMs? [message #1701968 is a reply to message #1701769] |
Fri, 17 July 2015 04:06  |
Eclipse User |
|
|
|
Hi Ryan,
You can find my answers below.
Regards,
Steve
Le 15/07/2015 15:33, Ryan Schimpel a écrit :
> Hi Steve,
> thank you for your response.
>
> Yes, it is true that their is a common superclass from which all nodes
> inherit. So in general, actually displaying the hierarchy is less of an
> issue; I would prefer that each type have it's own styling as to
> visually differentiate itself from the other types of nodes but for now,
> let's set that aside.
In addition of my previous answer about conditional styles or style
customization: if the only difference between each style of type is an
icon path, you will "just" need a style customization for each type (an
expression checking the type) with a "Property Customization (by
expression)" with the specific icon path.
>
> The primary concern for me has to do with the tools; I need a "create
> node" entry in the palette corresponding to each of the types (including
> ones that third parties may create.) This list of types is NOT static
> and will increase with time as more functionality is added to our
> product; have to do all of this manually is not really an option as it
> would constantly be out of date and a maintenance nightmare. As such, I
> need to be able to generate tools dynamically and add them to the
> palette. Is this feasible right now?
I have a couple ideas:
- If you want to generate tools, the odesign file (VSM) is a model, so
you can contribute an eclipse contextual action on odesign file to
"synchronize" it. In the process you would scan the existing types in
the current version of the metamodel and then add the corresponding
tools. Note that with this method, the number of tools in the palette
might grow to a point that it becomes overwhelming for the user.
- Use a Generic tool [1]. In the tasks you could either call a Java
service [2] or an external java action [3] that would open a popup where
the user will select the specific type of the created element.
Regards,
Steve
[1]
https://www.eclipse.org/sirius/doc/specifier/diagrams/Diagrams.html#tools
[2]
https://www.eclipse.org/sirius/doc/specifier/general/Writing_Queries.html#service_methods
[3]
https://www.eclipse.org/sirius/doc/specifier/general/Model_Operations.html#external_java_action
>
> Thanks,
> Ryan
--
Steve Monnier - Obeo
Need professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
Goto Forum:
Current Time: Thu May 22 19:37:02 EDT 2025
Powered by FUDForum. Page generated in 0.04151 seconds
|