Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Re: About EMF tutorial -Philmann Dark
Re: About EMF tutorial -Philmann Dark [message #1731042] Mon, 02 May 2016 13:02 Go to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 31553
Registered: July 2009
Senior Member
This one is a little newer

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

You can always substitute your own model for one in a tutorial.


On 02.05.2016 14:36, ima cha wrote:
> Hello all, i was reading the EMF tutorial of Philmann Dark until the
> point "Starting the project" and i was wondering if there is a
> tutorial for the second case where i have a model description
> (diagram) or should i follow as the procedure of this first case?


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: About EMF tutorial -Philmann Dark [message #1731106 is a reply to message #1731042] Mon, 02 May 2016 20:05 Go to previous messageGo to next message
ima cha is currently offline ima chaFriend
Messages: 4
Registered: May 2016
Junior Member
Thank you so much. Actually, I'm a beginner in using EMF and i wonder if this could help me to know how to use reflective interfaces, i had an idea about them and i need to use them in my application where i found a piece of code in a book but it isn't mentioned how to recuperate the references of package and factory ( first and second line, just comments)
[1] EFactory fact = //obtention de la référence
[2] EPackage pa = //obtention de la référence
[3] EClass acEC = (EClass) pa.getEClassifier("Acteur");
[4] EObject ac = fact.create(acEC);
[5] ac.eSet(acEC.getEStructuralFeature("nom") , "Client");
[6] EClass cuEC = (EClass) pa.getEClassifier("CasdUtilisation");
[7] EObject cu1 = fact.create(cuEC);
[8] cu1.eSet(cuEC.getEStructuralFeature("intitulé") , "Commander Panier");
[9] EObject cu2 = fact.create(cuEC);
[10] cu1.eSet(cuEC.getEStructuralFeature("intitulé") , "Valider Panier");

When i did a search i was directed to the tutoial that i asked about. So i really appreciate if you indicate me the tutorials i have to read and how to recuperate that references.
Re: About EMF tutorial -Philmann Dark [message #1731143 is a reply to message #1731106] Tue, 03 May 2016 07:36 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 31553
Registered: July 2009
Senior Member
Of course the EMF book is the most complete reference. There's all the
documentation on this page:

https://www.eclipse.org/modeling/emf/docs/

This might help a bit

http://www.ibm.com/developerworks/library/os-eclipse-dynamicemf/

Also the code in EcoreUtil illustrates many use cases for reflective access.


On 02.05.2016 22:19, ima cha wrote:
> Thank you so much. Actually, I'm a beginner in using EMF and i wonder
> if this could help me to know how to use reflective interfaces, i had
> an idea about them and i need to use them in my application where i
> found a piece of code in a book but it isn't mentioned how to
> recuperate the references of package and factory ( first and second
> line, just comments)
>
> [1] EFactory fact = //obtention de la référence
> [2] EPackage pa = //obtention de la référence
> [3] EClass acEC = (EClass) pa.getEClassifier("Acteur");
> [4] EObject ac = fact.create(acEC);
> [5] ac.eSet(acEC.getEStructuralFeature("nom") , "Client");
> [6] EClass cuEC = (EClass) pa.getEClassifier("CasdUtilisation");
> [7] EObject cu1 = fact.create(cuEC);
> [8] cu1.eSet(cuEC.getEStructuralFeature("intitulé") , "Commander
> Panier");
> [9] EObject cu2 = fact.create(cuEC);
> [10] cu1.eSet(cuEC.getEStructuralFeature("intitulé") , "Valider Panier");
>
> When i did a search i was directed to the tutoial that i asked about.
> So i really appreciate if you indicate me the tutorials i have to read
> and how to recuperate that references.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: About EMF tutorial -Philmann Dark [message #1731145 is a reply to message #1731106] Tue, 03 May 2016 07:48 Go to previous messageGo to next message
Felix Dorner is currently offline Felix DornerFriend
Messages: 363
Registered: December 2015
Senior Member
On 02-May-16 22:19, ima cha wrote:
> Thank you so much. Actually, I'm a beginner in using EMF and i wonder if
> this could help me to know how to use reflective interfaces, i had an
> idea about them and i need to use them in my application where i found
> a piece of code in a book but it isn't mentioned how to recuperate the
> references of package and factory ( first and second line, just comments)
>
> [1] EFactory fact = //obtention de la référence
> [2] EPackage pa = //obtention de la référence

If you know which package/factory it is, you can just use
"Packagename"Factory.eINSTANCE and "Packagename"Package.eINSTANCE. Also,
there is "Packagename"Package.Literals which has constant interface
fields for all the elements in the package.

If you do not know the package, but the package uri namespace
identifier, you can look it up in the package registry:

EPackage.Registry.INSTANCE.getEPackage()/getEFactory()

hth,
FElix
Re: About EMF tutorial -Philmann Dark [message #1731552 is a reply to message #1731145] Fri, 06 May 2016 18:00 Go to previous message
ima cha is currently offline ima chaFriend
Messages: 4
Registered: May 2016
Junior Member
Thank you all, so much. That was really helpful.
Previous Topic:help installing eclipse ide
Next Topic:need help related to host, port, sid, username, password
Goto Forum:
  


Current Time: Tue Oct 27 07:27:53 GMT 2020

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

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

Back to the top