Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Development of a UI with EMF forms without a data model
Development of a UI with EMF forms without a data model [message #1815906] Tue, 15 October 2019 01:36 Go to next message
Clever Alves is currently offline Clever AlvesFriend
Messages: 36
Registered: August 2019
Member
Hi there!

I'm a beginner in EMF and, as far as I know, the normal course of action, when developing a UI with EMF forms, is to render both data model (say, in UML) and EMF's view model.

I'm wondering whether I could develop a UI with EMF forms without a data model, actually, I'd like to generate a data model from such a UI...Is it possible? If so, links to detailed information or examples would be highly appreciated.

Thank you for your attention.

Regards,

Clever.
Re: Development of a UI with EMF forms without a data model [message #1815909 is a reply to message #1815906] Tue, 15 October 2019 04:29 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30685
Registered: July 2009
Senior Member
No, you need a model in which to store the data and you need that model to design the form.

The model need not be designed graphically, but it can be done with a UM-like graphical notation:

https://www.eclipse.org/ecoretools/

Or you can use just the Sample Ecore Editor to design your model in a structured editor as described here:

https://eclipsesource.com/blogs/tutorials/emf-tutorial/

Or you could use a textual notation such as Xcore, or OCLInEcore

https://wiki.eclipse.org/Xcore
https://wiki.eclipse.org/OCL/OCLinEcore
Re: Development of a UI with EMF forms without a data model [message #1815956 is a reply to message #1815909] Wed, 16 October 2019 00:49 Go to previous messageGo to next message
Clever Alves is currently offline Clever AlvesFriend
Messages: 36
Registered: August 2019
Member
Thank you for your reply, Ed!

I'm new in the field, but I've already seen you're a great expert! Congratulations on your contributions to this amazing platform!

"https://www.eclipse.org/ecoretools/" => I think Ecore models would suit me best. By the way, as far as I know, Ecore features class diagrams just as UML. However, does Ecore also feature, say, sequence and activity diagrams (or something equivalent to what's offered by UML in this sense)?

Regards,

Clever.
Re: Development of a UI with EMF forms without a data model [message #1815960 is a reply to message #1815956] Wed, 16 October 2019 03:47 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30685
Registered: July 2009
Senior Member
No, Ecore is much, much smaller than UML (and was used to implement UML). Look at the class diagrams at the bottom this page:

https://download.eclipse.org/modeling/emf/emf/javadoc/2.10.0/org/eclipse/emf/ecore/package-summary.html
Re: Development of a UI with EMF forms without a data model [message #1816002 is a reply to message #1815960] Thu, 17 October 2019 01:29 Go to previous messageGo to next message
Clever Alves is currently offline Clever AlvesFriend
Messages: 36
Registered: August 2019
Member
Thank you for your reply, Ed!

I've seen an Ecore model generates interfaces and implementations with getters and setters. Can I use, say, references, to automatically generate other application-specific methods (code form of UML's activity diagrams), as well as sequencing the program (code form of UML's sequence diagrams)?

Thank you for your attention.

Regards,

Clever.
Re: Development of a UI with EMF forms without a data model [message #1816004 is a reply to message #1816002] Thu, 17 October 2019 03:53 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30685
Registered: July 2009
Senior Member
Where there's a will there's a way. EMF's Core framework provides only generation from the Ecore model. You can transform other models to Ecore models, e.g., we transform a *.xsd to a *.ecore to generate a model for representing XML instances conforming to an XML Schema. UML2 similarly provides transformation from *.uml2 to *.ecore, and even has its own extended GenModel as well as extensions for the code generation JET templates. In the simplest form, you can transform to EOperations with a "GenModel" body annotation which will generate the Java code in that annotation into the body of the correspondingly generate Java operation; this is how Xcore's operation bodies (expressed in XBase), are ultimately generated as Java code.

But for someone not wanting to develop a UI form without a model that's wading very deeply into modeling territory.

Re: Development of a UI with EMF forms without a data model [message #1816041 is a reply to message #1816004] Thu, 17 October 2019 22:39 Go to previous message
Clever Alves is currently offline Clever AlvesFriend
Messages: 36
Registered: August 2019
Member
Thank you for your reply, Ed!

"In the simplest form, you can transform to EOperations with a "GenModel" body annotation which will generate the Java code in that annotation into the body of the correspondingly generate Java operation" => This apparently suits me best...Would you have a URL with an example?

At a later project phase, I aim to use JET to parse through the XML instance output, but I may not have enough time for that...would it make sense?

Regards,

Clever.
Previous Topic:Loading ecore and XMI: Class is not found or is abstract
Next Topic: Problem occured while invoking director
Goto Forum:
  


Current Time: Sat Dec 07 04:05:13 GMT 2019

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

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

Back to the top