Home » Modeling » Papyrus » Best route to submodels
Best route to submodels [message #1179450] |
Sun, 10 November 2013 09:22 |
Tomas Sandkvist 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 |
|
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
|
|
|
Goto Forum:
Current Time: Sat May 04 07:51:15 GMT 2024
Powered by FUDForum. Page generated in 0.02672 seconds
|