Skip to content

Replace queries with single service class#354

Open
stefanolsen wants to merge 3 commits intovaldisiljuconoks:v9from
stefanolsen:feature/rewrite-queries
Open

Replace queries with single service class#354
stefanolsen wants to merge 3 commits intovaldisiljuconoks:v9from
stefanolsen:feature/rewrite-queries

Conversation

@stefanolsen
Copy link
Contributor

@stefanolsen stefanolsen commented Apr 4, 2025

This PR seeks to replace the number of queries and query handlers with a single service class.

This way instantiating the service graph is simpler, methods can be overridden and we end up using the default dependency injection framework.

This is what is referred to in #345.

…rewrite-queries

# Conflicts:
#	common/src/DbLocalizationProvider/LocalizationProvider.cs
#	common/src/DbLocalizationProvider/ReflectionConverter.cs
@stefanolsen
Copy link
Contributor Author

@valdisiljuconoks This is WIP to show the idea early on. Is this refactoring fine by you?

Note: test cases are not yet updated.

@valdisiljuconoks
Copy link
Owner

hi, idea with composition of queries and commands was - to be able to override single command and have different behavior.
for example: default implementation is set for aspnet core web applications, however overriding few commands/queries, you can get functionality adapted for episerver (without overriding whole repositories).

we need to measure what is perf. implications for cqrs vs plain repos.

@stefanolsen
Copy link
Contributor Author

Isn't it okay to override the whole repository class? That way we are using the default service container. With the CQRS model, it seems to require a custom resolver.

@stefanolsen
Copy link
Contributor Author

@valdisiljuconoks Is it not open enough for overrides when it is in a service backed by a public interface?

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