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

Split ICrudAppservice and implementations #4346

Merged
merged 12 commits into from
Jun 30, 2020
Merged

Split ICrudAppservice and implementations #4346

merged 12 commits into from
Jun 30, 2020

Conversation

NecatiMeral
Copy link
Contributor

Resolve #4282

Updated AbstractKeyCrudAppService to use the newly introduced AbstractKeyReadOnlyAppService.
Implemented ReadOnlyAppService to provide a easy point to implement own (readonly) services.

I have not provided default implementations for ICreateAppService, IUpdateAppService and IDeleteAppService because this would lead to a load of duplicated code.
Maybe the CrudAppService implementation should act as a aggregating application service which delegates the methods to the actual services implementation, this would create a new layer of complexity and breaking changes.
This has to be discussed first.

The issues requirements are adressed.

@hikalkan hikalkan self-requested a review June 14, 2020 21:26
@hikalkan hikalkan added this to the 3.0 milestone Jun 14, 2020
@hikalkan
Copy link
Member

Thanks. I will review.

@hikalkan hikalkan requested a review from maliming June 16, 2020 11:27
@hikalkan
Copy link
Member

Thanks @NecatiMeral for your contribution. I reviewed and it seems OK.

However, this is a critical change and I want to get a deeper review from @maliming and @liangshiw
Guys, please review it deeply, test it and also consider namings... etc.
Thanks a lot.

@realLiangshiwei realLiangshiwei self-requested a review June 22, 2020 08:57
@maliming
Copy link
Member

hi @NecatiMeral

I think we should use read-only repository in read-only application services. eg: IReadOnlyRepository. what do you think?

public interface IReadOnlyRepository<TEntity> : IQueryable<TEntity>, IReadOnlyBasicRepository<TEntity>

@NecatiMeral
Copy link
Contributor Author

hi @maliming,

thanks for your review. This makes totally sense. I'll check the possibilities and update this PR.

…lication services

Still using `protected new` on `CrudAppService` because the repository member in `AbstractKeyCrudAppService` has to be renamed to something like `AbstractKeyRepository`, which would be a breaking change.

Renaming the repository in each descendant could lead to misunderstandings, since in `CrudAppService` descendants will be three repositories to choose from: `Repository`, `ReadOnlyRepository`, `AbstractKeyRepository`.
Currently the user must only differ between `ReadOnlyRepository` and `Repository`.

@maliming, can you review this?
@maliming maliming merged commit c014a1f into abpframework:dev Jun 30, 2020
@gdlcf88

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Introduce read-only app service
5 participants