Book a Demo

Author Topic: Best language for scripting EA  (Read 8774 times)

ocroquette

  • EA User
  • **
  • Posts: 93
  • Karma: +0/-0
    • View Profile
Best language for scripting EA
« on: June 20, 2007, 03:28:05 am »

I am considering the possible languages to use the automation interface of EA.

So far, it appears I have the following possibilities:

  • Visual Basic: Pro: standard Con: Messy (personal opinion :) )
  • C#: Pro: standard, scalable Con: ?
  • Python: Pro: easy, good scripting language Con: non standard under Windows, not supported by Sparx I guess
  • Java: Pro: supported by EA, widely known Con: interface in beta version only


So my questions are:
  • Which language are you using for serious automation of EA?
  • Which one would you recommend when starting from scratch?


Thanks!

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Best language for scripting EA
« Reply #1 on: June 20, 2007, 04:10:41 am »
VB.Net (vs. VB) same as C# for EA purposes.
No, you can't have it!

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Best language for scripting EA
« Reply #2 on: June 20, 2007, 05:01:58 am »
Quote
VB.Net (vs. VB) same as C# for EA purposes.
C# (vs. C++) same as VB.Net for EA purposes...  ;)

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

thomaskilian

  • Guest
Re: Best language for scripting EA
« Reply #3 on: June 20, 2007, 11:00:19 am »
I use Perl for historical reasons. But I would prefer python over it. And several people do use it as I know from several threads.

ocroquette

  • EA User
  • **
  • Posts: 93
  • Karma: +0/-0
    • View Profile
Re: Best language for scripting EA
« Reply #4 on: June 20, 2007, 11:36:08 pm »
Thanks for your opinions!

I searched a bit based on that, and most people seems to think that choosing between C# and VB.Net is a matter of taste .

However, many seem to complain about the lack of optional parameters support in C#, particularly when using COM interfaces making use of them.

Is that the case with the EA interface?

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Best language for scripting EA
« Reply #5 on: June 20, 2007, 11:50:02 pm »
Quote
Thanks for your opinions!

I searched a bit based on that, and most people seems to think that choosing between C# and VB.Net is a matter of taste .

However, many seem to complain about the lack of optional parameters support in C#, particularly when using COM interfaces making use of them.

Is that the case with the EA interface?
I believe there is support for variable parameters in C# it's just a special type of parameter and must be placed last (but I don't have the IDE open at present to search help)

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Best language for scripting EA
« Reply #6 on: June 21, 2007, 01:36:11 am »
You might be able to get away with passing Type.Missing to an optional parameter for which you have no data. Depending on the nature of the COM server, this has been known to work.
No, you can't have it!

ufechner

  • EA User
  • **
  • Posts: 85
  • Karma: +0/-0
  • I love YaBB 1 Gold!
    • View Profile
Re: Best language for scripting EA
« Reply #7 on: July 11, 2007, 01:56:56 am »
What's wrong with Python?
I use it successfully, it is easy to use.
I posted some examples in the EA wiki.

Regards:

Uwe Fechner

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Best language for scripting EA
« Reply #8 on: July 11, 2007, 02:28:32 am »
There's nothing wrong with Python, as the examples demonstrate.

Thanks Uwe.
No, you can't have it!

ocroquette

  • EA User
  • **
  • Posts: 93
  • Karma: +0/-0
    • View Profile
Re: Best language for scripting EA
« Reply #9 on: July 11, 2007, 03:21:08 am »
Although I like Python very much, there is something wrong with it in this context.

The reason is actually stated in the first post: it's not a standard Windows technology.

You need 2 third-party software pieces to run any script.

I see at least 2 major issues:

  • Support: EA won't provide any support or workaround in case of bugs in the 3rd party software
  • Deployment of Python+the Win32 interface


ufechner

  • EA User
  • **
  • Posts: 85
  • Karma: +0/-0
  • I love YaBB 1 Gold!
    • View Profile
Re: Best language for scripting EA
« Reply #10 on: July 19, 2007, 12:02:05 am »
Well, if you want to choose the best language, you have to know for which purpose.
I develop python scripts for the automation of EA for inhouse use only, so the deployment is no problem.

And support is no problem for me either:

You wont't get support for C# or .net from sparx, and you won't get support for python.
I did need support from sparx twice, one time there was a bug in EA with huge UseCase diagrams, and once a missing COM interface method.

If you have a problem with python, ask in the appropriate python forum and you will get a quick answer.

In our company we use delphi (for GUI applications), python (for inhouse non-GUI applications) and C (for embedded development), and we want to avoid to use more languages.

Developing software in python is very efficient and easy to validate, so you get high quality results quickly.

I hope to publish some more add-ons for EA, written in python in the future (in the moment I write a converter, that generates LaTex code from classes and requirements).

Regards:

Uwe Fechner
embedded development
« Last Edit: July 19, 2007, 12:02:56 am by ufechner »

Jeff Odell

  • EA User
  • **
  • Posts: 99
  • Karma: +0/-0
    • View Profile
Re: Best language for scripting EA
« Reply #11 on: July 29, 2007, 03:20:51 pm »
Coming from the Microsoft development environment, I've had pretty good success using C#.  I originally created NAnt tasks, now MSBuild tasks, for things like producing HTML web sites, reports, exporting, etc.  That allowed me to add producing output from EA into nightly builds, etc.

I've also used C# to produce a couple add-ins without a problem.

I'm interested in creating Powershell cmdlets to make it easy to script EA features.