问题
I am wondering if it is possible to build an AddIn Extension for Enterprise Architect in Java.
I am searching, but I have not found any concrete answers. Could someone give me a recommendation for this situation?
回答1:
Well it looks like, you can't build Enterprise Architect AddIns just using plain java code. There's a readme.txt
file to be found in your EA installation's Java API
directory:
Enterprise Architect Java API Readme
The files in this directory can be used to access Enterprise Architect's COM automation API from Java. To use this API, please observe the following set-up procedure.
- Copy the file SSJavaCOM.dll into any location within the Windows PATH. For example, the windows\system32 directory.
- Copy the eaapi.jar file to a location in the Java CLASSPATH or where the Java class loader can find it at run time
Limitations and known issues:
1. You cannot currently use this API to write plug-ins for EA. It is only suitable for accessing the automation server API.
2. Due to the nature of Java interacting with native methods and COM, garbage collection is not optimal. Native COM classes and memory allocated for these is not seen by the Java garbage collector, so you should explicitly invoke a garbage collection from time to time when working with many objects using the Java API. This will ensure native memory is freed in a timely fashion.
You may be able, to provide a java code based .NET assembly. I'm not so well versed with this, but IIRC I've been reading it's possible.
IMHO the most straightforward way to build an AddIn is to use c#. Have a look at Geert Bellekens Blog: "Tutorial: Create your first C# Enterprise Architect addin in 10 minutes"
Here are some more opinions, why java doesn't seem to be a good choice as the core language to develop an Enterprise Architect AddIn.
来源:https://stackoverflow.com/questions/26288883/is-it-possible-to-create-enterprise-archetict-extensions-using-java