Re: [PHP-DEV] Class Friendship in PHP

2015-12-10 Thread flaupretre
Hi Dustin, - Mail original - > De: "Dustin Wheeler" > > In my opinion, class friendship is explicit. I reach for this feature > when I need to say, "Hey, you two objects; one of you is going to > know > more than the rest of my system knows about this other object.

Re: [PHP-DEV] Class Friendship in PHP

2015-12-10 Thread Bishop Bettini
On Thu, Dec 10, 2015 at 12:02 AM, Dustin Wheeler wrote: > > Both of these approaches acknowledge the problem-space of > "private collaborators". "Private collaborators" itself is perhaps > loaded terminology as it happens to reuse an already-defined concept > in this domain:

Re: [PHP-DEV] Class Friendship in PHP

2015-12-10 Thread Rowan Collins
Bishop Bettini wrote on 10/12/2015 14:44: On Thu, Dec 10, 2015 at 12:02 AM, Dustin Wheeler wrote: I don't know that I would use friendship as a means to make an entire package (namespace, in PHP's case) aware of a single object. I think it's the other way around: a single

Re: [PHP-DEV] Class Friendship in PHP

2015-12-09 Thread Dustin Wheeler
Thank you very much for the comments, François. On Tue, Dec 8, 2015 at 6:01 AM, wrote: > > Hi, > > Thanks for this interesting and well-documented message. > > When looking at the history about class friendship, you may have seen that > the concept was globally rejected in

Re: [PHP-DEV] Class Friendship in PHP

2015-12-08 Thread xn--franois laupretre-dsb
Hi, - Mail original - > De: "Dustin Wheeler" > friendship protect the original class from unwarranted access. The > common > expression of these properties is something like: "Just because I > grant you > friendship access to me doesn’t automatically grant your kids

Re: [PHP-DEV] Class Friendship in PHP

2015-12-08 Thread xn--franois laupretre-dsb
Hi, - Mail original - De: guilhermebla...@gmail.com > My biggest concern about supporting friend classes is the ability to access > non-intentional to be accessed code outside of the original class's > knowledge. This by itself is very dangerous. That's the opposite : the 'friend'

Re: [PHP-DEV] Class Friendship in PHP

2015-12-08 Thread flaupretre
Hi, Thanks for this interesting and well-documented message. When looking at the history about class friendship, you may have seen that the concept was globally rejected in favor of Guilherme's project of 'package-privacy'. I personnally think friend classes are a different and more powerful

[PHP-DEV] Class Friendship in PHP

2015-12-07 Thread Dustin Wheeler
Hi! The topic of class / function friendship has been recently discussed and previously covered in the past through this list as well as through feature requests against bugs.php.net. I've recently developed an interest in the feature after reaching for a tool that just didn't exist in a language

Re: [PHP-DEV] Class Friendship in PHP

2015-12-07 Thread guilhermebla...@gmail.com
Hi, My biggest concern about supporting friend classes is the ability to access non-intentional to be accessed code outside of the original class's knowledge. This by itself is very dangerous. I do see however package-private classes as a possibility (I actually have a partially running patch

Re: [PHP-DEV] Class Friendship in PHP

2015-12-07 Thread Dustin Wheeler
Hi, Hi, > > My biggest concern about supporting friend classes is the ability to > access non-intentional to be accessed code outside of the original class's > knowledge. This by itself is very dangerous. > Just to clarify, the original class explicitly declares friends of itself. There is no