spmallette commented on pull request #1308: URL: https://github.com/apache/tinkerpop/pull/1308#issuecomment-726841623
> I just discovered from the code comments that SubgraphStrategy has an unusual implementation for concatenating two withStrategies() steps: the second one simply supersedes the first one instead of &&-ing the predicates of the two SubgraphStrategies as one would expect. I'm not sure that we have any strategy that is designed in such a way that more than one instance can be added. Even `OptionsStrategy` has special handling such that calls to `with()` find the strategy first and modify it rather than adding multiple instances with the expectation that they merge. > Personally, I would not object against modifying the semantics of SubgraphStrategy concatenation, thus introducing a breaking change. What is your preference what to do and in what ticket/PR? I have not checked yet whether &&-ing the predicates is easy to implement. Perhaps we should make the implicit rule of a single strategy instance explicit somehow. All strategies might not be mergeable as easily as say `OptionsStrategy` so perhaps we could create an interface that provides a method to merge them. If that interface isn't present on a strategy added more than once we could raise an error. I don't know if `SubgraphStrategy` will merge predicates well...i guess it would just wrap the predicate in `and()`? That's already a really complex strategy...would hate to make it more so. Created https://issues.apache.org/jira/browse/TINKERPOP-2473 for further consideration/discussion. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected]
