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

EZP-31279: Injected content domain mappers into the Repository #2913

Merged

Conversation

alongosz
Copy link
Member

@alongosz alongosz commented Jan 9, 2020

Question Answer
JIRA issue EZP-31279
Bug/Improvement yes
New feature no
Target version master (8.0@dev) for eZ Platform v3.0
BC breaks no (internal Service)
Tests pass yes
Doc needed no

Summary

This PR makes Content Type and Content domain mappers injectable Symfony Services and injects them into the Repository instead of building them on the fly.

Moreover those mappers were moved into the proper namespace:

  • \eZ\Publish\Core\Repository\Helper\ContentTypeDomainMapper
    into \eZ\Publish\Core\Repository\Mapper\ContentTypeDomainMapper,
  • \eZ\Publish\Core\Repository\Helper\DomainMapper
    into eZ\Publish\Core\Repository\Mapper\ContentDomainMapper (also renamed for better clarity).

Please see distinct commits for all the changes.

Background

It's a part of a larger decoupling story. The major issue with the current architecture is a lot of cyclic dependencies and a lot of changes needed to modify direct dependencies of Repository. The good example is Content Thumbnail feature which has been implemented recently. To inject ThumbnailStrategy service into the ContentDomainMapper we had to modify: RepositoryFactory (x2), Repository, related tests and the domain mapper itself. This is very much not SOLID and causes cyclic dependency issues. With the changes from this PR ThumbnailStrategy can be removed from Repository as a follow-up. This is just one example of course.

QA

You can use the qa-cumulative-ezp-31278-31279-decouple-content-mappers-limitation-svc branch to test both #2913 and #2914

TODO:

  • Wait for Travis
  • Fix new code according to Coding Standards ($ composer fix-cs).
  • Ask for Code Review.

@alongosz alongosz force-pushed the ezp-31279-decouple-content-domain-mappers branch from 122a4cb to d549402 Compare January 27, 2020 09:51
@micszo micszo self-assigned this Jan 30, 2020
@alongosz alongosz force-pushed the ezp-31279-decouple-content-domain-mappers branch 2 times, most recently from 467b228 to 6d75327 Compare February 25, 2020 19:53
@alongosz
Copy link
Member Author

@adamwojs I've resolved conflict with #2844 and injected proxy factory using setter via da0f7c2. The downside to that is having the proxy factory built both in Repository and via DIC. Can't resolve this issue until ProxyFactory is decoupled from Repository, so it needs to be as is (unless you know any possible issues with that).

Additionally fixed minor type-hinting issue via 6d75327.

@alongosz alongosz force-pushed the ezp-31279-decouple-content-domain-mappers branch from 6d75327 to 1e4ee38 Compare February 26, 2020 11:20
@alongosz
Copy link
Member Author

@adamwojs @micszo rebased after merging #2914

Copy link
Member

@micszo micszo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QA Approved on eZ Platform EE master.

@micszo micszo removed their assignment Feb 26, 2020
@alongosz alongosz merged commit 746db80 into ezsystems:master Feb 27, 2020
@alongosz alongosz deleted the ezp-31279-decouple-content-domain-mappers branch February 27, 2020 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

5 participants