Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Using an External API with EMF(How can I use an external API with EMF?)
Using an External API with EMF [message #1780622] Wed, 24 January 2018 21:16 Go to next message
Michael Sipos is currently offline Michael SiposFriend
Messages: 3
Registered: January 2018
Junior Member
Hello,

I am new to using the Eclipse Modeling Framework, and wanted to use it to develop a Java application that needs to use an external API (BWMirror in this case) to send function calls and work with classes/data-types defined inside the API.

I have gone through various tutorials, forum posts, and even purchased the EMF Manual; but I still haven't found a clear description as to how I can interact with External Libraries and other resources.

The EMF is a very useful framework to use for Model-Driven Software Development, but I can't completely rely on using Plugins from the Eclipse Marketplace and the standard Java Development Kit/Libraries to develop my applications.

Please let me know if I am overlooking something, because I can't believe there's a development framework that doesn't allow developers to integrate external libraries or communicate with external APIs.

Thank you.
Re: Using an External API with EMF [message #1780634 is a reply to message #1780622] Thu, 25 January 2018 06:55 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Any jar can be easily wrapped in a bundle so that PDE can manage the classpath. But EMF also works stand-alone, so you can manage the classpath like you do for any "normal" (non-PDE nature) Java project. And you can tell the GenModel to stop generating the MANIFEST.MF, plugin.xml or updating the .classpath, i.e., Update Classpath false. But personally I think it is far easier if you wrap your jar dependencies in a plugin. Just use the wizard to create a new Plug-in project, create a folder, e.g., lib, put all your *.jars in there, open the MANIFEST.MF, and on the Runtime tab use the Classpath section to Add... the jars in the lib folder, and then use the Exported Packages to list packages in those jars that you want visible elsewhere. With this approach you can manage your classpath simply by managing which jars are in the lib folder of the wrapper plugin and it will all be highly portable.

In your model you can use EDataTypes to wrap any Java class or interface and then you can use them in any other parts of your model.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Using an External API with EMF [message #1780682 is a reply to message #1780634] Thu, 25 January 2018 16:57 Go to previous messageGo to next message
Michael Sipos is currently offline Michael SiposFriend
Messages: 3
Registered: January 2018
Junior Member
Thank you very much! Your reply clears up a lot of uncertainties that I had surrounding the usage of EMF.

Thank you!!
Re: Using an External API with EMF [message #1780685 is a reply to message #1780682] Thu, 25 January 2018 17:05 Go to previous message
Michael Sipos is currently offline Michael SiposFriend
Messages: 3
Registered: January 2018
Junior Member
Also: I think the EMF Tutorials should have a page on how developers can perform these actions to readily work with EMF. As the documentation's wording tends to sound like EMF is only a tool for developing IDEs or other tools within the Eclipse Project.
Previous Topic:Creation of intermediate classes in FeaturePath
Next Topic:[Validation]
Goto Forum:
  


Current Time: Fri Apr 19 22:47:39 GMT 2024

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

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

Back to the top