Skip to main content



      Home
Home » Modeling » UML2 » What is the best way to publish UML models and profiles for reuse?(Can we setup a development and production environment?)
What is the best way to publish UML models and profiles for reuse? [message #1853224] Thu, 23 June 2022 08:04 Go to next message
Eclipse UserFriend
I defined my UML model by importing different UML packages (separated files) and also a profile. So my model has references to all of these packages and several packages are using the profile like:

- Model.uml
    import Package 1
    import Package 2
- Profile.uml
- Package 1.uml
    import and apply Profile
- Package 2.uml
    import and apply Profile
    import Package 1


If I publish these files onto the Internet, a person that would load the model using its URI won't have any of the imported packages loaded because the references are relative. It means that this person has to download by himself all the packages imported by the model before he can load the model in the editor.

So we could define an URI for each package and make the model use these URI as references. This way, when someone load the model using its URI, the editor will also fetch the referenced packages because it knows where to fetch them thanks to the URIs.

But this solution is not good for development because we have to publish every change we made onto the Internet so the files could be properly reloaded into our editor.

So I'm wondering if we can setup a development and production environment? The development environment would use relative files. The production environment would use URIs. How do you handle this?

Thanks,
Maxime
Re: What is the best way to publish UML models and profiles for reuse? [message #1853225 is a reply to message #1853224] Thu, 23 June 2022 08:17 Go to previous messageGo to next message
Eclipse UserFriend
Hi, Maxime,

In your development environment you could set up the ResourceSets used by your editors with URI mappings in the URIConverter that map the public URIs of your packages to local development resources.

Have a look at the ResourceSet::setURIConverter(...) and URIConverter::getURIMap() APIs. You can probably search references to the latter to see, for example, how the UML2 run-time itself sets up URI mappings for "pathmap:" scheme URIs.

HTH,
Christian
Re: What is the best way to publish UML models and profiles for reuse? [message #1853233 is a reply to message #1853225] Thu, 23 June 2022 11:09 Go to previous messageGo to next message
Eclipse UserFriend
Thanks Christian!

Can we map URIs for a specific environment using the Eclipse UML2 graphical editor?

Or do I have to write my own "building" program for converting URIs for production from the development uml files? This way, I would use the UML2 graphical editor to develop (working with relative paths). Then I would run the "building" program every time I'm ready to publish a new release on the Internet.
Re: What is the best way to publish UML models and profiles for reuse? [message #1853234 is a reply to message #1853225] Thu, 23 June 2022 11:15 Go to previous messageGo to next message
Eclipse UserFriend
Hi

If your users are IDE users, everything should be magically available through the magic of plugin extension points, provided you carefully package your plugin. You should find that /org.eclipse.ocl.pivot.uml/model/OCLforUML.profile.uml is packaged in this way, albeit with quite a few additional UML support classes that you do not need to emulate. IIRC Papyrus has its own catalog and so the Papyrus developers had to build in knowledge of OCLforUML after I developed it. Perhaps this has been rectified so that Papyrus now uses the traditional extension points.

If your users are standalone (Java API) users, it is recommended that you provide a standalone init. e.g. XXXStandaloneSetup.doSetup() for an Xtext editor. PivotStandaloneSetup.doSetup() for the Pivot OCL. UMLResourcesUtil.init() for UML. This minimizes the effort for users, maximizes the chances they get it right and allows you to evolve the init as your code evolves. Beware that it is undesirable, but sometimes necessary, to modify the global registries. Much better to only tweak per-ResourceSet registries so that you do not affect the next application phase.

Historically a degree of indirection is/was supported by pathmap: I'm afraid that I have never understood them; they just seem like a needless complexity. Anyway I developed UMLResourcesUtil.init() so that they were well hidden. IIRC pathmap: is not actually an XML scheme in so far as there is no code to support it. Rather it is just a spelling convention for a virtual name that will fail unless there is an appropriate URI mapping.

Regards

Ed Willink
Re: What is the best way to publish UML models and profiles for reuse? [message #1853235 is a reply to message #1853233] Thu, 23 June 2022 11:27 Go to previous message
Eclipse UserFriend
Maxime Lecoq wrote on Thu, 23 June 2022 11:09
Thanks Christian!

Can we map URIs for a specific environment using the Eclipse UML2 graphical editor?


I think you should be able to define an Eclipse plug-in that uses EMF's "uri_mapping" (not sure of the name) extension point to define the mappings from public URIs to development-time (maybe platform:/resource) URIs. Then you could deploy that plug-in into your development Eclipse workbench so that all editors, including the UML2 editor, get those URI mappings.

Making these mappings available to specific editors only would require some mechanism peculiar to them, about which I cannot comment.

Cheers,
Christian
Previous Topic:Exception raised when applying stereotype
Next Topic:Problems with generation of model instance
Goto Forum:
  


Current Time: Wed Jul 30 12:21:16 EDT 2025

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

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

Back to the top