LocalizationProvider icon indicating copy to clipboard operation
LocalizationProvider copied to clipboard

Replace queries with single service class

Open stefanolsen opened this issue 1 year ago • 4 comments

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.

stefanolsen avatar Apr 04 '25 11:04 stefanolsen

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

Note: test cases are not yet updated.

stefanolsen avatar Apr 04 '25 11:04 stefanolsen

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.

valdisiljuconoks avatar Apr 13 '25 05:04 valdisiljuconoks

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 avatar Apr 19 '25 17:04 stefanolsen

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

stefanolsen avatar Sep 19 '25 03:09 stefanolsen