You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@vxquery.apache.org by Till Westmann <ti...@apache.org> on 2016/08/02 03:54:31 UTC

recursively processing JSON items

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\u2019d 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

Re: recursively processing JSON items

Posted by Riyafa Abdul Hameed <ri...@cse.mrt.ac.lk>.
Hi,

I have updated a PR[1] with the suggested changes.

[1] https://github.com/apache/vxquery/pull/128

Thank you.

Yours sincerely,
Riyafa

On 2 August 2016 at 09:24, Till Westmann <ti...@apache.org> wrote:

> 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
>



-- 
Riyafa Abdul Hameed
Undergraduate, University of Moratuwa

Email: riyafa.12@cse.mrt.ac.lk
Website: https://riyafa.wordpress.com/ <http://riyafa.wordpress.com/>
<http://facebook.com/riyafa.ahf>  <http://lk.linkedin.com/in/riyafa>
<http://twitter.com/Riyafa1>