Using an External API with EMF [message #1780622] |
Wed, 24 January 2018 16:16  |
Eclipse User |
|
|
|
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 01:55   |
Eclipse User |
|
|
|
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.
|
|
|
|
Re: Using an External API with EMF [message #1780685 is a reply to message #1780682] |
Thu, 25 January 2018 12:05  |
Eclipse User |
|
|
|
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.
|
|
|
Powered by
FUDForum. Page generated in 0.08376 seconds