The example discussed here shows how the Bank_MultiLanguage.ump project was split up into multiple subprojects.
|Note:||UModel allows you to share packages and UML diagrams they might contain, between different projects. Packages can be included in other projects by reference, or as a copy. Please see Sharing Packages and Diagrams for more information.|
Creating subproject files
Subproject files can be split off a main, or subproject, file at any time.
To create a subproject file:
|1.||Right-click a package(s) e.g. Banking access and select Subproject | Create new Subproject.|
|2.||Click the Browse button and select the subdirectory \Bank_MultiLanguage_Java.|
|3.||Select "Editable" to be able to edit the subproject from the main project. (Selecting Read-only makes it uneditable in the main project.) Then click OK.|
The name of the subproject file is shown in square brackets next to the package name and the file Banking access.ump file is placed in the UModelExamples\Bank_MultiLanguage_Java folder.
The same method is used to create a subproject of the BankView folder. The BankView.ump file is placed in the ...\UModelExamples\Bank_MultiLanguage_Java\ folder.
|Notes:||The file path of the subproject can be changed at any time by right clicking the subproject and selecting Subproject | Edit File Path.|
Opening and editing subproject files
Having created a subproject file, the resulting *.ump file can then be opened, and edited, as a "main" UModel project file. For this to be successful there should not be any unresolved references to other elements. UModel automatically performs checks when creating a subproject from the "main" project, and whenever a file is saved.
|•||Right-click the subproject package (e.g. Bank Server.ump) in the main project and select Project | Open as Project. This starts another instance of UModel and opens the subproject as a "main" project. Any unresolved references are shown in the Messages window.|
Subprojects that have been split off from a main project can be used in any other main project(s).
|1.||Right-click a project and select Project | Include Subproject.|
|2.||Click the Browse button and select the *.ump file that you want to include, e.g. Banking access.ump.|
|3.||Choose how the file is to be included; by reference tor as copy.|
When saving the main project file, all editable subproject files are also saved. I.e. all data contained in the shared packages of the subproject files are saved.
You should therefore not create/add data (components) outside of the shared/subproject structure, if the subproject is defined as "editable" in a main project file. If data exists outside of the subproject structure, a warning message will be displayed in the Messages window.
Saving subproject files
When saving subprojects (from the main project level) all references to sibling, as well as child subprojects, are considered and saved. E.g. if two sibling subprojects, sub1 and sub2, exist and sub1 uses elements from sub2, then sub1 is saved in such a way that it automatically saves references to sub2 as well.
If sub1 was opened as a "main" project, then it is considered as a self contained project and can be edited without any reference to the actual main project.
Reintegrating subprojects into the main project
Previously defined subprojects can be copied back into the main project again. If the subproject does not contain any diagrams then the reintegration will be immediate. If diagrams exist a dialog box will open.
|1.||Right-click the subproject and select Subproject | Include as Copy. This opens the "Include Subproject" dialog box, which allows you to define the diagrams styles you want to use when including the subproject.|
|2.||Select the style option that you want to use, then click OK to include the project again.|
© 2019 Altova GmbH