Class versioning (Same Platform)
Multiple applications are connected with the cache environment and you want to upgrade client applications. You cannot upgrade all the applications at the same time. Meanwhile, if some classes get upgraded in some applications, how can they share data with other old ones? Here comes the concept of Class Versioning.
If your class is Serializable and you write objects of the class to a data source and then later read them back in, you need the same version of the class to read with what you used to write it with. If you want to use one version of a class to save something that acts like an object data base, and then change the class (new version), you won't be able to read the new version.
With NCache’s feature of Class Versioning Compatibility for same platforms, you can use the class versioning feature by configuring them through administrative cache tools and providing mapping for attributes with target class. See Registering Classes for Portable Data Sharing in NCache Administrator's Guide.
Class Attributes Mapping | |
---|---|
ProductV2 Class (C#) | ProductV1 Class (C#) |
id | id |
name | name |
price | price |
quantity | quantity |
discount |
After mapping ProductV2 with ProductV1, you will be able to store ProductV2 and get it in ProductV1 and vice versa.