Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » private package imports
private package imports [message #581944] Sat, 03 February 2007 05:42
Rafael Chaves is currently offline Rafael ChavesFriend
Messages: 362
Registered: July 2009
Senior Member
I am trying to handle private package imports, with no success.

Let's say we have a model "modelA" that declares a class named "Class1":

<?xml version="1.0" encoding="UTF-8"?>
<uml:Model xmi:version="2.1"
xmlns:xmi="http://schema.omg.org/spec/XMI/2.1"
xmlns:uml="http://www.eclipse.org/uml2/2.0.0/UML"
xmi:id="_2lOwILNDEduNmdZ-0W_wwA" name="modelA">
<packagedElement xmi:type="uml:Class"
xmi:id="_5ddhgLNDEduNmdZ-0W_wwA" name="Class1">
</packagedElement>
</uml:Model>

And another model "modelB" that all it does is to import "modelA" with a
private PackageImport:

<?xml version="1.0" encoding="UTF-8"?>
<uml:Model xmi:version="2.1"
xmlns:xmi="http://schema.omg.org/spec/XMI/2.1"
xmlns:uml="http://www.eclipse.org/uml2/2.0.0/UML"
xmi:id="_S7eQILNIEduJpMikpuhDAQ" name="
<packageImport xmi:id="_S7qdYbNIEduJpMikpuhDAQ" visibility="private">
<importedPackage xmi:type="uml:Model"
href="modelA.uml#_S7L8QLNIEduJpMikpuhDAQ"/>
</packageImport>
</uml:Model>

So that tells me that all elements imported from modelA into modelB are
private to modelB (section 7.3.39 - "If the PackageImport is public, the
imported elements will be visible outside the package, while if it is
private they will not.").

I am trying to honor the UML spec and prevent people from creating
models that import modelB to make references to Class1, but the problem
is that the visibility of modelB::Class1 (in other words, modelA::Class1
as imported into modelB) is public. Shouldn't it be private instead? Is
this a bug in UML2? Any workarounds?

Thanks,

Rafael
Previous Topic:Profile reapplication
Next Topic:UML2 installation question
Goto Forum:
  


Current Time: Fri Apr 26 17:09:11 GMT 2024

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

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

Back to the top