Author Topic: Code engineering: import javascript  (Read 3828 times)

mcoletti

  • EA User
  • **
  • Posts: 45
  • Karma: +0/-0
    • View Profile
Code engineering: import javascript
« on: May 17, 2013, 01:25:14 am »
Hi, I am developing some code in Google Apps script. I have several javascript sources. Is there a way to import them in EA? This could help saving some manual typing time.
Regards,
Massimo

F@lk

  • EA User
  • **
  • Posts: 38
  • Karma: +0/-0
    • View Profile
Re: Code engineering: import javascript
« Reply #1 on: May 23, 2013, 05:10:38 pm »
I also need that feature since parts of our product (web interface) is written in JavaScript. And the JS/UML plugin for Eclipse does not work.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8063
  • Karma: +118/-20
    • View Profile
Re: Code engineering: import javascript
« Reply #2 on: May 24, 2013, 08:55:19 am »
The problem with Javascript is that even when written as object oriented it doesn't really match the way we expect object oriented code to look. I'm not even 100% sure we could write a parser to detect the class definitions etc. in a consistent way.

F@lk

  • EA User
  • **
  • Posts: 38
  • Karma: +0/-0
    • View Profile
Re: Code engineering: import javascript
« Reply #3 on: May 24, 2013, 04:58:56 pm »
js/uml (http://jsuml.gaertner-network.de/) seems to restrict to JavaScript that is written in the styles of JSDoc, Dojo, or YUI. I think that way can be a good compromise. Usually a programmers decides for a known pattern to code object-oriented, and so the parser can decide as well, maybe using information given by user settings.

A class here is usually written like this:
Code: [Select]
var Foo = new (function () {
   var m_fooParam = 0;
   ...
   this.setFooParam = function (fooParam) {
      ...
   };
   this.getFooParam = function () {
      return m_fooParam;
   };
   ...
});