Sparx Systems Forum

Discussion => General Board => Topic started by: Andrefern on May 18, 2006, 06:00:01 am

Title: import *
Post by: Andrefern on May 18, 2006, 06:00:01 am
Hi,

I'm trying to define a dependency relation between a class and a package (package1) as import. I'd like to generate code of this class with:

import xxx.xxxx.xxxx.package1.*

But it haven't worked. Have I done something wrong?

Thanks.
Title: Re:  import *
Post by: thomaskilian on May 18, 2006, 06:42:52 am
You should mention the language you're using...
Title: Re:  import *
Post by: Andrefern on May 18, 2006, 06:54:29 am
Java
Title: Re:  import *
Post by: «Midnight» on May 18, 2006, 07:06:56 am
Is this something of your own design - a part of your model - that needs to be imported somewhere else? Or, are you attempting to import a part of the Java environment?

In the latter case you'll have to use EA's Import Binary Module to bring the Java environment into your model somewhere. There is a lot of info here in the forum on how to do that, so try a search.

David
Title: Re:  import *
Post by: Andrefern on May 18, 2006, 07:12:19 am
This package is from my own design. But, if it were from some package in Java Environment I would like to do the same.

I don't like verbose imports. Anyway, it's a good pratice use import *.
Title: Re:  import *
Post by: «Midnight» on May 18, 2006, 07:17:13 am
But difficult for EA and other tools to interpret.
Title: Re:  import *
Post by: Simon M on May 18, 2006, 03:11:18 pm
If you really want to do this, then you're going to need to add a list over connectors in your import section template.  Add as a condition in the list that the source needs to be the current element, the target should be a package and the connector type should be a dependency.

Sorry, I can't give a code fragment that would do it at the moment.
Title: Re:  import *
Post by: Andrefern on May 19, 2006, 11:42:06 am
Ok.

Thanks for your answers.  ;)