Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Incorporating Validations at Runtime
Incorporating Validations at Runtime [message #1730330] Mon, 25 April 2016 05:50 Go to next message
Puneet Patwari is currently offline Puneet PatwariFriend
Messages: 64
Registered: November 2014
Member
Hi All

I have an interesting requirement for my DSL. Xtext provides the hook for writing validation rules on the model in the <MyDSL>Validator class, out of the box. It works fine. But now, I want to do something differently.

I want to put additional validations at runtime. To explain it further, after creating the DSL projects the next step is to run an eclipse instance. This provides a workbench where we can create the DSL files corresponding to my grammar.Quote:
Is there any way to put validation rules(using a class or anything else) at the runtime eclipse instance so that it works similar to the backend validation class?


I want to know if this is at all possible. If yes, I want to get some ideas of how to approach this? For example, we can create an xtend class in the runtime eclipse and somehow bind it to the Xtext validation framework. but how?

Expert help is solicited. Thanks in advance. Smile

Puneet
Re: Incorporating Validations at Runtime [message #1731000 is a reply to message #1730330] Mon, 02 May 2016 05:34 Go to previous messageGo to next message
Puneet Patwari is currently offline Puneet PatwariFriend
Messages: 64
Registered: November 2014
Member
Hi All

I am waiting for any reply. Is there no one that can help me with my requirement? Sad
Please help Christian, Sven, Jan.!!

Puneet
Re: Incorporating Validations at Runtime [message #1731003 is a reply to message #1731000] Mon, 02 May 2016 06:01 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13186
Registered: July 2009
Senior Member
you have basically do this yourself

Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Incorporating Validations at Runtime [message #1731006 is a reply to message #1731003] Mon, 02 May 2016 06:29 Go to previous messageGo to next message
Puneet Patwari is currently offline Puneet PatwariFriend
Messages: 64
Registered: November 2014
Member
Hi christian

Agreed. But any direction will be really helpful?? Is it even feasible? Do you think the idea is reasonably good? Otheriwse I would end up wasting a lot of time. I just want to know an expert's opinion about this, that's it.

Thanks for your reply.

Puneet
Re: Incorporating Validations at Runtime [message #1731008 is a reply to message #1731006] Mon, 02 May 2016 06:42 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13186
Registered: July 2009
Senior Member
i dont know if it is a good idea. you need a way to "find" and "classload" the user written validators (e.g. from a checkEObject(Eobject) method inside your validator.
this code wont be trivial so make sure it is worth the effort.


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Incorporating Validations at Runtime [message #1731010 is a reply to message #1731008] Mon, 02 May 2016 07:02 Go to previous message
Puneet Patwari is currently offline Puneet PatwariFriend
Messages: 64
Registered: November 2014
Member
Hmm... Ok. I will have to explore my options of implementation. By the way, Have you used Sirius? It has this beautiful techique that allows you to modify diagramatic descriptions (*.odesign) in the runtime and see the changes immediately in the same eclipse instance. It looks similar to what I want.

Also, I like the way, Sirius has provided the option of calling "Java Services" for complex scenarios to create mappings, etc.. I was thinking if such a philophy can be applied here. So when a user creates a DSL using the grammar, he also gets option to create java services for validation purpose. It's just preliminary thoughts. What do you think?

By the way, I would like help of you people to get it done. So, sorry for disturbing. Smile

Puneet
Previous Topic:JVM model inferrer comments out type reference
Next Topic:How to get eclipse runtime application exact location?
Goto Forum:
  


Current Time: Tue Nov 12 21:20:24 GMT 2019

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

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

Back to the top