Author Topic: Utility code classes for model addins  (Read 6168 times)

Elpis

  • EA User
  • **
  • Posts: 34
  • Karma: +6/-0
  • Make MDA/MBSE vital.
    • View Profile
Utility code classes for model addins
« on: January 24, 2024, 01:27:07 am »
While model addins are great idea, I seek for possibility to place some utility/library code into kind of <<Javascript>> class (as operations) and not into <<JavascriptAddin>> class itself.
That way a could develop some utility function set to be used in many model addins (shared code base).

The utility-class derived javascript object could be declared in model as addin class atrribute of specific type (i.e. utility class) and than accessed in the code with expression like:   this.Utility1.FunctionA() .

PS. There is somehow related proposal to be able to re-use javascripts from Scripting view, in a model addins ( https://sparxsystems.com/forums/smf/index.php/topic,43908.0.html , https://sparxsystems.com/forums/smf/index.php/topic,43400.0.html ). However, for model-addin developers placing addins' re-usable code in a model element, is IMHO more natural and consistent.

Elpis

  • EA User
  • **
  • Posts: 34
  • Karma: +6/-0
  • Make MDA/MBSE vital.
    • View Profile
Re: Utility code classes for model addins
« Reply #1 on: February 16, 2024, 09:51:04 pm »
The question seems to be resolved in https://sparxsystems.com/forums/smf/index.php/topic,48277.msg280361.html#msg280361
(A: a Dependency from <<JavascriptAddin>> Class to utility code Class)