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

Expanded ReadInterface #10672

Merged
merged 1 commit into from
Aug 31, 2017
Merged

Expanded ReadInterface #10672

merged 1 commit into from
Aug 31, 2017

Conversation

dverkade
Copy link
Member

@dverkade dverkade commented Aug 26, 2017

  • Expanded to ReadInterface to include the readAll function, since a class implementing the ReadInterface should have this function in order to substitute the Read class.

  • Removed comment variable declarations from other file where the type is declared. This was necessary due to the missing function in the interface. Autocompleting this function now works properly, so these comments can be removed.

…class implementing the ReadInterface should have this function in order to substitute the Read class.

- Removed comment variable declarations from other file where the type is declared. This was necessary due to the missing function in the interface. Autocompleting this function now works properly, so these comments can be removed.
@orlangur orlangur changed the title Expended ReadInterface Expanded ReadInterface Aug 26, 2017
@orlangur
Copy link
Contributor

Interfaces (even non-@api ones) cannot be expanded this way (see http://devdocs.magento.com/guides/v2.1/contributor-guide/backward-compatible-development/index.html#introduction-of-a-method-to-a-class-or-interface).

There are a lot of code yet which rely on implementation rather than on interface, not sure whether readAll was missed here or there was some reasoning behind.

@okorshenko okorshenko self-assigned this Aug 26, 2017
@okorshenko okorshenko added this to the August 2017 milestone Aug 26, 2017
@okorshenko
Copy link
Contributor

I agree with @orlangur about BC policy.

@dverkade
Copy link
Member Author

dverkade commented Aug 28, 2017

Hi @okorshenko,

The reason I have created the PR this way is that the ReadFactory class actually has a hard dependency to the Read class. So at this point the Read class does not offer an extension point in Magento. Since the readAll function is called in several other modules I assumed this function has been forgotten to be included in the ReadInterface, so I added this function to that interface. Since no real extension point is offered at this moment I thought I would by wise to change the interface directely. The classes implementing the ReadInterface already have the readAll function in them. Even if someone did manage to overwrite the Read class, the readAll function is still necessary for Magento to even work. So that's why I have changed the interface directly.

If you want this PR to be changed I would be happy to do so. Please guide me how you want me to do with this. I can create a ReadAllInterface which extends the ReadInterface. Then the Read class should implement the ReadAllInterface.

Please share your toughts.

@okorshenko
Copy link
Contributor

Thank you @dverkade for the detailed explanation. In normal case we should follow BC policy. I talked to other Magento Architects in we agreed that in this particular case we can accept this change for 2.3. This interface does not have @api annotation, so we can do this.
Thank you

@magento-team magento-team merged commit b5ee415 into magento:develop Aug 31, 2017
magento-team pushed a commit that referenced this pull request Aug 31, 2017
@dverkade
Copy link
Member Author

Hi @okorshenko,

Thanks. When I make future PR's I'll try to add the reason in the comments why I opted to create the PR in a certain way. Hope this makes it easier for you to accept or reject a certain PR.

@dverkade dverkade deleted the Expand_ReadInterface branch June 22, 2018 14:55
@Ctucker9233
Copy link

@magento-team Will this be backported to 2.2?

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.

5 participants