Support for old models after renaming component classes
Bug #1313829 reported by
Stan
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Workcraft |
Fix Committed
|
Wishlist
|
Danil Sokolov |
Bug Description
After the components were renamed in the SON models, the older models have stopped loading.
In future we need some mechanism to avoid such problem. (define the synonym list?)
Changed in workcraft: | |
importance: | Undecided → Wishlist |
Changed in workcraft: | |
status: | New → Confirmed |
assignee: | nobody → Danil Sokolov (danilovesky) |
milestone: | none → 3.0 |
summary: |
- support of old models after renaming components + Support for old models after renaming component classes |
tags: | added: core |
Changed in workcraft: | |
status: | Confirmed → Fix Committed |
To post a comment you must log in.
I think this is the expected and correct behaviour for the reflection based serialisation system. Because the components' class names are the only available identifiers of their type, renaming components is not something that can be taken lightly.
A robust way to handle this would be to version model plug-ins more rigorously. Any fundamental change such as the change in the supported component set must be treated as a new, incompatible w.r.t. the file formats model and a new version tag in the model code (so ideally the plugins should not be in the core source tree), while the old version that works with the older file format must still be able to be instantiated if needed. This way a very lightweight model transformer can be written that would upgrade the model instances to newer versions.
A quick but dirty solution is to simply unzip the .work file and use sed to replace the class names (provided only the names have changed).