Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Best route to submodels
Best route to submodels [message #1179450] Sun, 10 November 2013 09:22 Go to next message
Tomas Sandkvist is currently offline Tomas SandkvistFriend
Messages: 149
Registered: October 2013
Senior Member
I wonder what is the best way of using submodels when I have (many) dependencies between packages in the model.

If I already have created such dependencies (i.e. reused elements), and then create a submodel, will these dependencies solve themselves?

Or should I make sure I have done an import of these packages PRIOR to creating the submodel?

Also, based on my trials so far, is there another way other than to import a package from the model to reach elements I need?

And, also, putting elements into those imported packages, is that OK, (they are saved properly), but if I change anything, is that change properly propagated to any other point where the same package is imported (i.e. is there known issues in this mechanism)

I raise there questions because I had some problems that I couldn't figure out, but now that I think about it, perhaps I didn't use this function properly.

Regards,
Tomas Sandkvist
Re: Best route to submodels [message #1180027 is a reply to message #1179450] Sun, 10 November 2013 18:33 Go to previous message
Christian Damus is currently offline Christian DamusFriend
Messages: 1222
Registered: July 2009
Location: Canada
Senior Member

Hi, Tomas,

See some replies in-line, below.

HTH,

Christian


On 2013-11-10 09:22:54 +0000, Tomas Sandkvist said:

> I wonder what is the best way of using submodels when I have (many)
> dependencies between packages in the model.
>
> If I already have created such dependencies (i.e. reused elements), and
> then create a submodel, will these dependencies solve themselves?

Yes. EMF's cross-document references (HREFs) automatically resolve
themselves at run-time. It's like magic. The lazy-loading options in
Papyrus, however, may intercept that resolution process to prompt you
or take other action, so you may get unresolved references in some
circumstances. Usually manually loading a sub-model should fix those
up.


> Or should I make sure I have done an import of these packages PRIOR to
> creating the submodel?

You don't need UML PackageImports for this purpose. PackageImport
doesn't express a usage dependency; rather, it conceptually brings the
elements from the imported package *into* the importing namespace,
making them addressable (by qualified name) as members of the importing
namespace. It is quite orthogonal to sub-models and cross-document
references in general.

Note that you don't actually need sub-models to implement partitioning
at all. You could simply organize everything into a flat series of
packages that are all models unto themselves.


> Also, based on my trials so far, is there another way other than to
> import a package from the model to reach elements I need?
>
> And, also, putting elements into those imported packages, is that OK,
> (they are saved properly), but if I change anything, is that change
> properly propagated to any other point where the same package is
> imported (i.e. is there known issues in this mechanism)

Neither Papyrus (AFAIK) nor the UML2 API actually "effects" a package
import at run-time in any way. It is simply a relationship that
controls the behaviour of certain operations that enumerate the members
of a namespace, compute the names of an element in some namespace, etc.
No model elements are relocated in the model content tree.

So, putting elements into any package is always OK. Changes like that
don't need any kind of propagation.


> I raise there questions because I had some problems that I couldn't
> figure out, but now that I think about it, perhaps I didn't use this
> function properly.

Probably you simply don't need PackageImports.


> Regards,
> Tomas Sandkvist
Previous Topic:Model loading, what can I do with the different settings
Next Topic:Setting default value of enumeration
Goto Forum:
  


Current Time: Fri Dec 04 08:56:20 GMT 2020

Powered by FUDForum. Page generated in 0.01609 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top