Class ModelPersistence


  • public class ModelPersistence
    extends Object
    ModelPersistence handles all XML persistence versions supported by current MPS installation. The range of supported versions is [FIRST_SUPPORTED_VERSION, LAST_VERSION]. MPS must be able to read any of these persistence versions and write the last one.

    The "previous" persistence version being writable is not a must, but it is better to support it to have less moments when we accidentally need to convert between persistence versions. E.g. to be able to fix model before migration from previous version and save it in old persistence, or to merge two non-migrated branches without converting persistence.

    It is supposed that only one or two persistence versions are supported: the last persistence used by previous MPS version (to read and migrate project created in the previous version, and, sometimes, a new persistence introduced in current version. NOTE this is not mandatory, we can support more than two versions.

    We can't support full functionality on all created persistences as the change in persistence is actually made because of change in SModel. So, we can't actual SModel to a very old persistence or even read all the information from old persistence into a new SModel. The good thing about that is that we can "partially" support very old persistence versions where we might need such a support. See VCSPersistenceSupport for an example.