The following figure shows the domain model of the project decomposition.

Domain model of project decomposition


The core change is an introduction of com.nomagic.ci.persistence.IProject - com.nomagic.ci.persistence.IPrimaryProject and com.nomagic.ci.persistence.IAttachedProject. IPrimaryProject is a single instance in the scope of a project. IPrimaryProject can have attached (used) any number of IAttachedProject (used projects), while IAttachedProject itself can attach other used projects (IAttachedProject).

The earlier than 17.0.1 project structure API made deprecated in version 17.0.1. The deprecated classes from the com.nomagic.magicdraw.core.modules package are:

Committable

IProject

ModuleDescriptor

ModulesManager

MountHelper

MountInfo

MountTable

MountTableListener

ShareInfo

ShareTable


There is no straight one to one mapping, but  the set of deprecated classes are now generally replaced by the set of the following classes:

com.nomagic.magicdraw.core.ProjectUtilities

com.nomagic.ci.persistence.IProject

com.nomagic.ci.persistence.IPrimaryProject

com.nomagic.ci.persistence.IAttachedProject

com.nomagic.ci.persistence.decomposition.ProjectAttachmentConfiguration

com.nomagic.ci.persistence.mounting.IMountPoint

com.nomagic.ci.persistence.sharing.ISharePoint

ProjectUtilities and com.nomagic.magicdraw.core.modules.ModulesService utility classes are introduced to help working with a new project decomposition structure and should replace MountHelper.

ModuleDescriptor is replaced with a combination of IAttachedProject and com.nomagic.ci.persistence.decomposition.ProjectAttachmentConfiguration. There is separate ModuleDescriptor for every (same) project usage in MagicDraw 17.0 or earlier versions, while there is a single IAttachedProject for the used project, but a separate ProjectAttachmentConfiguration for every project usage in the current version.


The example of the MagicDraw 17.0 and earlier version code:

	final Collection<ModuleDescriptor> projectModules = project.getModulesManager().getMountTable().getModules()
	for (ModuleDescriptor moduleDescriptor : projectModules)
	{
		// properties of the project usage
		final AutoLoadKind autoLoadKind = moduleDescriptor.getAutoLoadType();
		final boolean loadIndex = moduleDescriptor.isLoadIndex();
		final boolean editable = moduleDescriptor.isEditable();
	}


The example of a new MagicDraw 17.0.2 code:

	final IPrimaryProject primaryProject = project.getPrimaryProject();
	final Collection<IAttachedProject> projectAttachedProjects = ProjectUtilities.getAttachedProjects(primaryProject);
	for (IAttachedProject attachedProject : projectAttachedProjects)
	{
		final ProjectAttachmentConfiguration attachmentConfiguration = ProjectUtilities.getAttachment(primaryProject, attachedProject);
		// properties of the project usage
		final AutoLoadKind autoLoadKind = ProjectUtilities.getAutoLoadKind(attachmentConfiguration);
		final boolean loadIndex = ProjectUtilities.isLoadIndex(attachmentConfiguration);
		final boolean editable = !attachmentConfiguration.isReadOnly();
	}