Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: mehmeteraymuslu on July 26, 2018, 10:23:31 pm

Title: Programming Language for Automation and Scripting
Post by: mehmeteraymuslu on July 26, 2018, 10:23:31 pm
Hello,

I am currently using Javascript for scripting EA. I learned SQL to be used on DB side. For automation I am thinking about learning Python. But I am not sure if EA goes well with Python. As far as I can see, most of the forum includes C# help topics. So is there anyone who is using Python and does anyone has a suggestion?

Thank you for taking your time to answer.
Title: Re: Programming Language for Automation and Scripting
Post by: Geert Bellekens on July 26, 2018, 10:40:40 pm
If you want to create add-ins then you probably want to go with C#.

In theory you could use any programming language that can generate a COM compatible dll, but I think the majority of existing add-ins is written in C#, and a minority in VB.

Geert
Title: Re: Programming Language for Automation and Scripting
Post by: Sunshine on July 27, 2018, 07:36:22 am
If you want to create add-ins then you probably want to go with C#.

In theory you could use any programming language that can generate a COM compatible dll, but I think the majority of existing add-ins is written in C#, and a minority in VB.

Geert
I concur with Geert on C#. For the additional reasons;
a) There seems to be more examples and support from C# developers
b) VB looks like its a dying language and finding developers is becoming harder.

You could use Python as its a powerful language but you probably on your own. So if your brave and feel you don't needs support then maybe Python is for you. But I suspect that isn't you as your asking about languages to learn.

JScript is what most of the folk I know use for scripting rather than VB or JavaScript. Reason being a) There are more examples in JScript. b) Is almost the same as JavaScript which is used a lot on web development now.

Hope that helps you come to a decision.
Title: Re: Programming Language for Automation and Scripting
Post by: Eve on July 27, 2018, 08:42:49 am
Of the scripting languages used in EA, I would recommend Javascript. Mainly because Microsoft no longer supports the script debugger used by EA for the other two.

If you're interested in writing add-ins, any .Net language will probably get you going the fastest. C# is probably the most popular of those.
Title: Re: Programming Language for Automation and Scripting
Post by: Sunshine on July 27, 2018, 09:48:25 am
Of the scripting languages used in EA, I would recommend Javascript. Mainly because Microsoft no longer supports the script debugger used by EA for the other two.
...
Good point that I hadn't thought of. Bring to mind two questions.
@Simon
a) Does that mean the example JScripts will be ported to JavaScript in future versions of Sparx EA?
b) Does Sparx Systems recommend a JavaScript Debugger to use with EA?
Title: Re: Programming Language for Automation and Scripting
Post by: Eve on July 27, 2018, 12:27:48 pm
a) Does that mean the example JScripts will be ported to JavaScript in future versions of Sparx EA?
It doesn't mean that. They could be at some point.

Unless I'm mistaken, the only 'Local Scripts' installed by EA that it matters for are the two 'Model Search' scripts. Converting those should be a matter of replacing ActiveXObject with COMObject. (see the help (http://www.sparxsystems.com/enterprise_architect_user_guide/14.0/automation/script_editors.html))

b) Does Sparx Systems recommend a JavaScript Debugger to use with EA?
EA includes a built-in debugger for Javascript that is not dependent on external components.
Title: Re: Programming Language for Automation and Scripting
Post by: qwerty on July 27, 2018, 07:19:22 pm
Go with Python if you like it (I use it more often recently though I completely dislike its version concept and some of its functional bread crumbs). You have almost full access to EA's API (there are very few things where you need work arounds). However, if you have a need for add-ins you will need compiled code. This "is" possible with Python but honestly it's a PITA.

q.
Title: Re: Programming Language for Automation and Scripting
Post by: mehmeteraymuslu on July 30, 2018, 11:23:56 pm
I almost completed my Javascript course, so chosing javascript for scripting wasn't a bad decision after all. I guess learning C# would be better choice(C# vs Python), because while learning new language I may need a lot of help. After I complete C# courses and have a certain level of self confidence, I may go for Python as well. My experience with C# may give me a head start while learning Python.

Thanks everyone for sharing precious comments.