Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Which Design Pattern is behind Evaluators? #382

Closed
elyosemite opened this issue Jan 16, 2024 · 1 comment
Closed

Which Design Pattern is behind Evaluators? #382

elyosemite opened this issue Jan 16, 2024 · 1 comment

Comments

@elyosemite
Copy link

I recently search in google about Evaluators Pattern, however I did not find out anything about design pattern that it calls Evaluators?

Help me get there and understand the design pattern behind it. Would it be the Rule Engine?

@elyosemite elyosemite changed the title Which Design Pattern behind Evaluators? Which Design Pattern is behind Evaluators? Jan 16, 2024
@fiseni
Copy link
Collaborator

fiseni commented Jan 19, 2024

Hi @elyosemite,

There is no pattern called Evaluators. I just came up with that name, because it made sense in our case. The specifications hold all query-related data, and at some point, we need to apply that state for a given provider. For EF, we apply all expressions on top of the DbSets, and return the final IQueryable. In the very first version, while we had support only for Where and Include, we had a single method GetQyery that did all of the work. But, that wouldn't scale well. That's why we came up with the current infrastructure, where we have isolated constructs to deal with different query features. We called them evaluators (partial evaluators and specification evaluators). This enables us easily to add/remove different evaluators per provider and also provides the ability to extend the evaluation with user-provided custom evaluators.

As for utilized patterns in the library, we're using the Singleton pattern, Strategy, Builder and so on.

@fiseni fiseni closed this as completed Jan 19, 2024
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

No branches or pull requests

2 participants