Book a Demo

Author Topic: How to import standard types?  (Read 3688 times)

mmo

  • EA User
  • **
  • Posts: 85
  • Karma: +0/-0
    • View Profile
How to import standard types?
« on: August 31, 2007, 01:00:02 pm »
Maybe a newbie question:

When defining new operations and attributes, usually certain standard classes (in my case, since I use Java, e.g. "String", or all classes in "java.util.*" or e.g. certain javax.* packages) can be taken as "given" and so one certainly does not want to redefine them in a new model over and over again.

But the type lists for parameters and return types by default only knows a few standard types (boolean, int, float, ...) and the types defined in the current model.

Can one somewhere obtain predefined "empty" models that already contain these standard classes or what is the suggested way to make such standard classes or libraries known?

Regards,
Michael

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: How to import standard types?
« Reply #1 on: August 31, 2007, 01:10:10 pm »
Michael,

What you need to do is import some or all (depending on your needs) of the Java library into a base project, then use a copy of that project as a 'starter' for each new model.

You will be able to do this via the Import Binary Module function. There are two ways to get there; look it up in EA help.

Search this forum for some useful tips on doing this, as well as how to import only the parts you need. Be persistent, since YABB (the forum software) is a bit strange about search results. The stuff you need is here, and it does work.

HTH, David
No, you can't have it!

Martin Terreni

  • EA User
  • **
  • Posts: 672
  • Karma: +0/-0
  • Sorry, I can't write
    • View Profile
Re: How to import standard types?
« Reply #2 on: August 31, 2007, 01:19:54 pm »
Won't it be expensive in performance? I tried to do the same with C# and the loading of the project turn to be very slow.
Wouldn't it be cheaper, even if incorrect, to just add them to defaults types list some way? (I'm sure there is)

Does it sound OK?
Recursion definition:
If you don’t understand the definition read "Recursion definition".

Aaron B

  • EA Administrator
  • EA User
  • *****
  • Posts: 941
  • Karma: +18/-0
    • View Profile
Re: How to import standard types?
« Reply #3 on: September 02, 2007, 03:05:36 pm »
You can selectively import standard java classes (e.g. Just import 'java.lang' classes) by extracting them from the rt.jar file and then importing them into EA.
For more information, see the following EA User Group WIKI page:
http://wiki.eausergroup.org/index.php?title=Code_Engineering

Just as a brief explaination: These 'standard' classes cannot be added as default datatypes because (1) they are not primitive datatypes, and (2) there is a chance that they may vary between JDK releases.  Because of this, it is left up to the user to import these classes from their target JDK platform.

HTH