-
-
Notifications
You must be signed in to change notification settings - Fork 505
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
Change private visibility to protected #1240
Comments
Making things protected means we have to keep BC for them only because somebody could have extended the class so I'm not in favour of this solution. @jmikola I remember you had some plans for sharding, orchestration and PRs we have for 1.x for this - maybe let's make a schedule for the feature? /cc @alcaeus |
Well that depends in how BC support is promised. I'd not suspect protected members and methods to be safe for BC. But I got your point and if it's Doctrine's policy to provide BC for protected members so be it then. And since we've got php 5.5 there are nice tricks to work around strict visibilities without using reflections. There are some cases where people need to change Doctrine's behavior more deeply for a certain (maybe very rare) use case. That would not be worth making it a feature. I have to admit that the sharding example is a bad one for a rare use case. |
Yes, the sharding example is the worst possible case you could've picked for arguing for protected support. I don't think there's another feature that has three open, unfinished PRs sitting around (#325, #691, #1025) ;) That being said, I also disagree with opening up a bunch of properties and methods for the sake of being extendable. Not every class contained in the package is meant to be extended or replaced. Since you need sharding support, how about giving #1025 a test run before being the next person to start from scratch? From the looks of it it is in a state you can test it (with the usual precautions about using non-production-grade software in production environments), and I would assume @clslrns appreciates any feedback he gets. Hopefully by the time 1.x comes around we won't need to have this discussion about making the DocumentPersister extendable to support sharding. |
Closing the ticket as private visibility will not be changed blindly, let's keep discussion about sharding in sharding-related threads. If we come to any conclusion internally on how we want to proceed I'll create new meta issue for that. |
This library uses private almost everywhere. This excessive private usage makes the ODM very unflexible.
Because of #304 I had to implement a custom document persister. In order to avoid code duplication, I tried to extend the default document persister, which became a pain. I had to work around the private everywhere.
My code basically looks like this:
And the persister:
The text was updated successfully, but these errors were encountered: