Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Model meta elements and their instances?
Model meta elements and their instances? [message #1808656] Fri, 28 June 2019 09:06 Go to next message
Matthias Steinkamp is currently offline Matthias SteinkampFriend
Messages: 3
Registered: June 2019
Junior Member
Hi there,

for an UI, I want to model the screen configuration within my DSL as well as their instances. It should be possible to describe the UI configuration options and create concrete instances.

E.g. Editors should contain different attributes which could be optional/mandatory and so on. Instances of specific editors need to set all mandatory attributes.

When I add all possible Editors and their attributes in the xtext DSL, I would know how to implement this. But with the editors as part of the concrete files, I'm lost.

Is this possible? Could you please give me some hints, how achive this? Thank you!

Greetings,
Matthias
Re: Model meta elements and their instances? [message #1808699 is a reply to message #1808656] Fri, 28 June 2019 18:20 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi I am not sure if I understand you problem

If you have two dsl or one dsl with two parts you can have something like

Class : „class" name =ID;

Instance: „inst" classed=[Class];

Then you can do the same with attributes scoping content assist


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Model meta elements and their instances? [message #1808702 is a reply to message #1808699] Fri, 28 June 2019 20:11 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

Adding a graphical model overlay onto an information model is a fairly standard problem. See Sirius and Papyrus.

So long as you always use the UI editor to edit one graphical overlay on one information model it is relatively straightforward. (The old Ecore Tools did this.) As soon as you start to accommodate independent collaborative information editing you hit a graphical catch-up / auto-layout challenge. Once you have multiple models you can get in a complete mess which is IMHO what both Papyrus and Sirius have done.

However since Sirius is there and works with arbitrary Ecore metamodels, I would recommend that you at least see how you get on with Sirius before attempting to do your own thing.

Regards

Ed Willink
Re: Model meta elements and their instances? [message #1809927 is a reply to message #1808656] Thu, 25 July 2019 18:48 Go to previous messageGo to next message
Matthias Steinkamp is currently offline Matthias SteinkampFriend
Messages: 3
Registered: June 2019
Junior Member
Hey, sorry for the late reply and sorry for my bad explanation.

I plan an UI platform with several different Views. Every view needs different properties, different widgets, content, variables to edit etc. About 10 different view types.

Now, as I see it, I could describe every particular view with it's properties in the DSL, so that I can create concrete UI menus in the .mydsl file.

However I'm interested if I can do it a step more abstract, so that the DSL does know there can be different views with possible properties (widgets), but it shall not define the actual combinations.

That way someone should be able to 1. Describe in the .mydsl file, what views are actually possible (e.g. "numeric editor" with one property "Variable" to edit) and afterwards 2. State that there are 10 actual numeric editor instances, editing variables a, b, c, ... Another customer might want to model an editor with three variables and only 2 actual instances.

"View" name=ID
"NumericEditor" is a View
"TemperatureSetpoint" is NumericEditor
"Brightness" is NumericEditor

If this approach is way to complicated, just say so.

I hope I explained it more clear this time. As I see it, part 1. Would be the meta model and 2. The model. And normally the DSL is the meta model and the .mydsl file is the concrete model?

Btw, what are the .mydsl files called? DSL instances?

Thank you very much for your patience and time!
Re: Model meta elements and their instances? [message #1809929 is a reply to message #1809927] Thu, 25 July 2019 18:52 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
DSL instances or simply models
for general topic:
I still don't see what the problem is with either having
One widget and one GUI / View dsl
Or a dsl with a widget and a GUI / View part


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Model meta elements and their instances? [message #1809930 is a reply to message #1809929] Thu, 25 July 2019 18:57 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
here is a very trivial example

Model:
classes+=Class*
instances*=Instance*;

Class: "class" name=ID "{" 
properties+=Property*
"}";

Property: name=ID;

Instance:
"inst" name=ID "of" clazz=[Class] "{"
propertyInstances+=PropertyInstance*
"}";

PropertyInstance: // TODO implement scoping for property
property=[Property] "=" value=STRING;



Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Model meta elements and their instances? [message #1809932 is a reply to message #1809930] Thu, 25 July 2019 19:31 Go to previous message
Matthias Steinkamp is currently offline Matthias SteinkampFriend
Messages: 3
Registered: June 2019
Junior Member
Ok thank you. Seems I'm overthinking it!
Previous Topic:Access to the fields of a package (Tree structure)
Next Topic:Exception when referencing between Resources in same ResourceSet
Goto Forum:
  


Current Time: Fri Apr 19 00:19:45 GMT 2024

Powered by FUDForum. Page generated in 0.01999 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top