butterfly
butterfly copied to clipboard
Add concept of global transformation context (for upgrades only)
Currently each upgrade step has no visibility about what has happened in prior upgrade steps, since each one has its own transformation context and they are isolated.
However, there a few cases where it would be necessary for an upgrade step to have some access to prior steps contexts, like #206 for example.
There are two possible solutions for this problem.
-
Introduce a global transformation context, which would be unique and shared by all upgrade steps, containing data that is common to all of them, allowing communication inter upgrade steps and removing the need for redundant execution and storage, improving also performance. This global transformation context would not replace each upgrade step context though, it would be an additional one, which could be retrieved from a
getGlobal
methodTransformationContext
. - Use a single transformation context, also unique and shared by all upgrade steps, but, different than option 1, this single transformation context would be in fact the only one, upgrade steps would not have individual transformation contexts. In this case, Butterfly should automatically add a prefix to each attribute name stating the upgrade step it refers to. This could introduce new problems though, especially when the developer decide that name explicitly.