Description
I would like to propose to deprecate the Resource Entity Separation feature. This feature allows different models to be used in the service layer and repository layer. See this example project
I propose to deprecate it because of the following reasons
1. It is unfinished
The feature is not well maintained, not documented and not production ready. Even though all tests related to this example project are passing, there are many cases that are not covered and I'm sure many of them will fail (compare with coverage of JsonApiExampleTests
). Still, there haven't been any bug reports about this, which probably means this feature isn't used a lot in production. This wouldn't surprise me because there is no documentation about this feature.
2. Usecase is unclear
It is unclear (at least to me) what problem is solved by being able to use a different class in the service layer vs repository layer. There are no indicators about this in the example project because there are no notable difference between the entity and resource model.
The only (incomplete) usecase I can come up with is wanting to have multiple "views" (resources) for one database entity. I am however not sure why allowing for resource entity separation would be the best/only approach to supporting something like this. For example: if the goal is changing the API output depending on authorization, transforming the data can be achieved by leveraging Resource Hooks. Even if there is a valid usecase, I'm still wondering if the extra complexity introduced by the support for resource entity separation outweighs the advantages of keeping ithe codebase simple.
3. Supporting it would greatly postpone time to production readiness
Adding this feature adds a great layer of complexity: every feature needs to be supported for the cases of "normal" usage (non-separated) as well as for usage with resource entity separation. This means that for release of v4, a great deal of work has to be put in in identifying and covering the unsupported use-cases, and new features like Resource Hooks also need to be compatible. The release of v4 would be postponed for a great amount leaving it in a not-production ready state for a longer period of time.
In conclusion
Even if resource entity separation turns out to be useful in certain situations, with the limited development capacity that we have I don't think it is worth maintaining it.
The repository history shows that @roblankey was the main contributor for this feature. I would be grateful to hear your thoughts on this. What was your motivation for this feature?
Any thoughts are welcome.