Skip to content

Criteria Expression Walker/Visitor#39

Merged
milt merged 5 commits into
criteriafrom
criteria_walker
Jul 24, 2026
Merged

Criteria Expression Walker/Visitor#39
milt merged 5 commits into
criteriafrom
criteria_walker

Conversation

@milt

@milt milt commented Jul 22, 2026

Copy link
Copy Markdown
Member

A speculative refactor that introduces a walker pattern to replace the quasi-repetitive recursive traversal code we have all over the place

@cliffcaseyyet cliffcaseyyet left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general I like the approach of the walker pattern and how it's handling everything and reducing cruft. More specifically, though, I suspect there are more java-idiomatic ways to solve it. Needs discussion

String activeCacheClass) {
}

private static final ExpressionWalker.Visitor<ReferenceState> REFERENCE_VISITOR =

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This inline extension syntax is bananas. Let's just make a Visitor abstract superclass and then a subclass for Reference?

}

/** Receives each expression and optionally derives state for each child edge. */
@FunctionalInterface

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what in tarnation? See other comment. I might need to hear a broader case for this methodology.

import java.util.List;

public class LogicalExpression implements Expression {
public final class LogicalExpression implements Expression {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the final?

@milt
milt marked this pull request as ready for review July 24, 2026 15:18
@milt
milt merged commit 1ea118f into criteria Jul 24, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants