[MAGNOLIA-6996] Streamline DefinitionProvider population in JcrConfigurationSource Created: 30/Mar/17 Updated: 30/Mar/17 |
|
| Status: | Accepted |
| Project: | Magnolia |
| Component/s: | None |
| Affects Version/s: | 5.5.2 |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Neutral |
| Reporter: | Aleksandr Pchelintcev | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Template: |
|
| Acceptance criteria: |
Empty
|
| Task DoD: |
[ ]*
Doc/release notes changes? Comment present?
[ ]*
Downstream builds green?
[ ]*
Solution information and context easily available?
[ ]*
Tests
[ ]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
| Description |
|
By design besides the definition bean itself DefinitionProvider also carries over the so-called DefinitionRawView, a map-like structure that is easier to traverse than the bean and which should be available even when the bean resolution completely failed. In case of JcrConfigSource in order to populate the raw view we extend the Node2BeanProcessor and piggyback on the transformation process populating the raw view along. Such approach has several certain drawbacks:
There is a simple way to improve the situation: use a separate algorithm to populate the raw view, then use vanilla N2B to populate then bean. The penalty of such approach is that the node traversal would happen not once but twice. However, since definition population is an infrequent operation (especially in production) - this shouldn't be a problem. As for the algorithm of resolving the DefinitionRawView from the JCR, there's a couple of obvious approaches: |