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 object declares its

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: `private`. The intent

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. I'm > doing this so th

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 favor of Guilherme's

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 access > to me, > doe

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' keywor

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

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 opp

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 for