[
https://issues.jboss.org/browse/WFCORE-9?page=com.atlassian.jira.plugin.s...
]
Kabir Khan commented on WFCORE-9:
---------------------------------
It is worth pointing out that in the current implementation, that operation transformers
calling TransformationContext.readResource() or .readResourceFromRoot() get the
**original** model. This is different from resource transformers where the output of the
previous version delta is the input into the next. For operation transformers, to do
'partial' transformation when reading the resource seems too hard.
Transformers chained for versions
---------------------------------
Key: WFCORE-9
URL:
https://issues.jboss.org/browse/WFCORE-9
Project: WildFly Core
Issue Type: Feature Request
Security Level: Public(Everyone can see)
Components: Domain Management
Reporter: Kabir Khan
Assignee: Kabir Khan
Fix For: 1.0.0.Alpha4
Say you have a subsystem with model versions 1.0, 1.1 and currently 2.0.
At present we register a transformer doing everything that needs doing from 2.0 to 1.1,
and another one duplicating all that with everything that needs doing from 1.1 to 1.0. As
more model versions are added, more transformers 'doing everything' are needed.
Richard and Tomaz have both come up with the same idea, to avoid this code duplication by
only having transformers for each model version increment, and to chain them together, so
you would have
* a transformer for 2.0 to 1.1
* a transformer for 1.1 to 1.0
Then if someone wanted to transform from 2.0 to 1.0 we would take the current
model/operation and feed that into the 2.0-to-1.1 transformer, giving us the 1.1
model/operation. The 1.1 model/operation would then be fed into the 1.1-to-1.0 transformer
giving us the 1.0 model/operation.
--
This message was sent by Atlassian JIRA
(v6.2.6#6264)