Skip to main content



      Home
Home » Newcomers » Newcomers » Re: About EMF tutorial -Philmann Dark
Re: About EMF tutorial -Philmann Dark [message #1731042] Mon, 02 May 2016 09:02 Go to next message
Eclipse UserFriend
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?
Re: About EMF tutorial -Philmann Dark [message #1731106 is a reply to message #1731042] Mon, 02 May 2016 16:05 Go to previous messageGo to next message
Eclipse UserFriend
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 03:36 Go to previous messageGo to next message
Eclipse UserFriend
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.
Re: About EMF tutorial -Philmann Dark [message #1731145 is a reply to message #1731106] Tue, 03 May 2016 03:48 Go to previous messageGo to next message
Eclipse UserFriend
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 14:00 Go to previous message
Eclipse UserFriend
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: Fri Jul 25 09:11:35 EDT 2025

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

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

Back to the top