Hi Riyafa, hi Christina,

looking at the PRs for

- libjn:descendant-objects [1]
- libjn:descendant-arrays  [2]
- libjn:descendant-pairs   [3]

it seems that there is (not surprisingly) a lot of overlap.
I think that it would be good to extract the common code that navigates
through the JSON items into an AbstractJsonItemScalarEvaluator.
I’d expect this abstract evaluator could implement everything for these 3
evaluators with the exception of one abstract "processPair" and one
abstract "processArray" method (the rest of the code could probably be taken
straight out of [3] with renaming "nestedObject" to "processObject" and
"insideArray" to "processArray")

Does this make sense?

If so, maybe Riyafa could go ahead and implement descendant-objects and
descendant-pairs based on an AbstractJsonItemScalarEvaluator and then
Christina would re-implement descendant-arrays based on Riyafa's
implementation?

Cheers,
Till

[1] https://github.com/apache/vxquery/pull/128
[2] https://github.com/apache/vxquery/pull/129
[3] https://github.com/apache/vxquery/pull/130

Reply via email to