Re: [PEPr] Comment on Networking::Net_SMPP

From: Date: Sat, 11 Jun 2005 20:28:35 +0000
Subject: Re: [PEPr] Comment on Networking::Net_SMPP
References: 1 2 3  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-38083@lists.php.net to get a copy of this message
On Saturday 11 June 2005 01:58 am, bertrand Gugger wrote: > Bonjour Ian, > > >>Could you present your Net_SMS implementation, as maintainer of it I did > >>not get a copy and anyway a practical example of Net_SMPP's (and client) > >>use would be meaningfull. > > > >Attached. > > It would be more value to link it as an example for the client proposal > Added. > >I mailed this to the Net_SMS leads. They weren't too happy that my code > > needed a patch to work; I explained why, and never got anything back. > > Your code does not need that ! > You can perfectly handle your extra parameters in your own class. > I would also oppose myself to such a change,. > The plain generic_smpp class doesn't, but I have a 'mblox_us_psms_smpp' driver which has correct defaults set for that vendor, so I don't have to fiddle with setting it in my calling code all the time. I think that something to have class defaults is useful, and I don't think my changes are that extreme, but I can look for an alternate solution if it's rejected. > >So, Net_SMS devs, what do I need to change for you to accept this? > > Yes, Net_SMS colleagues , could you review Ian's proposal ? > Net_SMS could become the first "user" of Net_SMPP, bulk sending is a > good prospect, I think > > >>The factories should do: $obj =& new $class(...); return $obj; > >>instead of: return new $class(...); > > > >Is there a reason for this? Does 'return new...' copy instead of return a > >reference? > > My point is > either returning a reference but then without an intermediate copy > or returning a copy without reference > No half way. > I don't see how my code is "half way." 'return new Class();' in a function which returns a reference should return a reference to the newly-created class without an intermediate copy. Perhaps I don't understand. Could you explain the difference between 'return new' and '$new =& new class; reurn $new;' in detail, please? As long as the function has an & prefix (and mine do), it should create a single object and return a reference to it either way. > >>I tested out _unpack() on PHP4.2.2 , seems ok. > >>Generally, I still not understand this over complicated structure, or if > >>it's due, I would say it is quite difficult to check :), could you > >> produce some schema/explanations ? > > > >The structure of _unpack(), or of the package(s) as a whole? > > whole, > this _unpack is no mistery for me :) , I got it in nose long time ago :) > I mean, it would save us some time to analyze the strucure if we had a > litle explanation of it and why it is so. That could help people to > review your proposal. > Edited the Net_SMPP proposal and added a Package Structure section. Let me know if you have any questions which aren't addressed by that. > >>How is the vendor set in Client ? > > > >$smsc =& new Net_SMPP_Client('smsc.provider.com', 3204); > >$smsc->vendor = 'myVendor'; > >$smsc->connect(); > > funny, no setter here ? > I don't see the value in having a function that just sets a public class variable.

Attachment: [application/pgp-signature]
« previous php.pear.dev (#38083) next »