Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-11 Thread Nathan Nobbe
On 10/11/07, Robert Cummings <[EMAIL PROTECTED]> wrote: > > On Thu, 2007-10-11 at 07:19 -0500, Jay Blanchard wrote: > > [snip] > > What I was really illustrating is how interfaces are syntactic > > sugar only. In my above example what I've really shown is an > > implicit interface :) Since OOP is l

RE: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-11 Thread Robert Cummings
On Thu, 2007-10-11 at 07:19 -0500, Jay Blanchard wrote: > [snip] > What I was really illustrating is how interfaces are syntactic > sugar only. In my above example what I've really shown is an > implicit interface :) Since OOP is largely meant to model real > world things, ask yourself this... when

RE: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-11 Thread Jay Blanchard
[snip] What I was really illustrating is how interfaces are syntactic sugar only. In my above example what I've really shown is an implicit interface :) Since OOP is largely meant to model real world things, ask yourself this... when a doctor sews a pig's heart into a human, do you think there's an

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-10 Thread Nathan Nobbe
On 10/10/07, Robert Cummings <[EMAIL PROTECTED]> wrote: > > On Wed, 2007-10-10 at 22:15 -0400, Nathan Nobbe wrote: > > well i have to say i dont really see the difference between an > > implicit and explicit interface. > > > > the example you gave looks like it works just like the example i gave. >

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-10 Thread Robert Cummings
On Wed, 2007-10-10 at 22:15 -0400, Nathan Nobbe wrote: > well i have to say i dont really see the difference between an > implicit and explicit interface. > > the example you gave looks like it works just like the example i gave. > > in your example the check for the function is performed at runt

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-10 Thread Nathan Nobbe
well i have to say i dont really see the difference between an implicit and explicit interface. the example you gave looks like it works just like the example i gave. in your example the check for the function is performed at runtime. in the example i gave the check for the interface is performed

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-10 Thread Robert Cummings
On Wed, 2007-10-10 at 20:57 -0500, Larry Garfield wrote: > On Wednesday 10 October 2007, Nathan Nobbe wrote: > > On 10/10/07, Robert Cummings <[EMAIL PROTECTED]> wrote: > > > What I was really illustrating is how interfaces are syntactic > > > sugar only. In my above example what I've really shown

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-10 Thread Larry Garfield
On Wednesday 10 October 2007, Nathan Nobbe wrote: > On 10/10/07, Robert Cummings <[EMAIL PROTECTED]> wrote: > > What I was really illustrating is how interfaces are syntactic > > sugar only. In my above example what I've really shown is an > > implicit interface :) Since OOP is largely meant to mod

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-10 Thread Robert Cummings
On Wed, 2007-10-10 at 20:45 -0400, Nathan Nobbe wrote: > On 10/10/07, Robert Cummings <[EMAIL PROTECTED]> wrote: > > > > What I was really illustrating is how interfaces are syntactic > > sugar only. In my above example what I've really shown is an > > implicit interface :) Since OOP is largely mea

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-10 Thread Robert Cummings
On Wed, 2007-10-10 at 17:46 -0400, Nathan Nobbe wrote: > On 10/10/07, Robert Cummings <[EMAIL PROTECTED]> wrote: > On Wed, 2007-10-10 at 13:30 -0500, Jay Blanchard wrote: > > [snip] > > so what are the benefits of the "with interfaces" solution > over > > the

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-10 Thread Nathan Nobbe
On 10/10/07, Robert Cummings <[EMAIL PROTECTED]> wrote: > > What I was really illustrating is how interfaces are syntactic > sugar only. In my above example what I've really shown is an > implicit interface :) Since OOP is largely meant to model real > world things, ask yourself this... when a doct

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-10 Thread Robert Cummings
On Wed, 2007-10-10 at 17:46 -0400, Nathan Nobbe wrote: > On 10/10/07, Robert Cummings <[EMAIL PROTECTED]> wrote: > On Wed, 2007-10-10 at 13:30 -0500, Jay Blanchard wrote: > > [snip] > > so what are the benefits of the "with interfaces" solution > over > > the

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-10 Thread tedd
At 9:38 AM -0400 10/10/07, Nathan Nobbe wrote: On 10/10/07, tedd <[EMAIL PROTECTED]> wrote: At 9:54 PM -0400 10/9/07, Nathan Nobbe wrote: i hope i have been able to contribute something to someone amidst all the arguing. -nathan Yeah, you gave me a better apprecia

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-10 Thread Nathan Nobbe
On 10/10/07, Robert Cummings <[EMAIL PROTECTED]> wrote: > > On Wed, 2007-10-10 at 13:30 -0500, Jay Blanchard wrote: > > [snip] > > so what are the benefits of the "with interfaces" solution over > > the"without > > > interfaces" solution > > [/snip] > > > > Polymorphism. > > Bleh, polymorphism isn'

RE: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-10 Thread Robert Cummings
On Wed, 2007-10-10 at 13:30 -0500, Jay Blanchard wrote: > [snip] > so what are the benefits of the "with interfaces" solution over > the"without > > interfaces" solution > [/snip] > > Polymorphism. Bleh, polymorphism isn't unique to interfaces. In fact, PHP has polymorphism all over the place by

RE: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-10 Thread Jay Blanchard
[snip] I wouldn't play with a lawnmower class in the first place. I use PHP to write web applications which deal with database tables, not lawnmowers, and I have yet to find a good reason for using interfaces in such applications. Your contrived examples do not convince me of anything. [/snip]

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-10 Thread Tony Marston
""Nathan Nobbe"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On 10/10/07, Tony Marston <[EMAIL PROTECTED]> wrote: >> >> >> ""Jay Blanchard"" <[EMAIL PROTECTED]> wrote in message >> news:[EMAIL PROTECTED] >> [snip] >> >> so what are the benefits of the "with interfaces" solution

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-10 Thread Nathan Nobbe
On 10/10/07, Tony Marston <[EMAIL PROTECTED]> wrote: > > > ""Jay Blanchard"" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > [snip] > >> so what are the benefits of the "with interfaces" solution over > >>the"without interfaces" solution > [/snip] > > > Polymorphism. > > Are you say

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-10 Thread Tony Marston
""Jay Blanchard"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] [snip] >> so what are the benefits of the "with interfaces" solution over >>the"without interfaces" solution [/snip] > Polymorphism. Are you saying that it is not possible to have polymorphism without using interface

RE: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-10 Thread Jay Blanchard
[snip] so what are the benefits of the "with interfaces" solution over the"without > interfaces" solution [/snip] Polymorphism. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-10 Thread Nathan Nobbe
On 10/10/07, Larry Garfield <[EMAIL PROTECTED]> wrote: > > > On Wed, 10 Oct 2007 13:39:31 -0400, "Nathan Nobbe" <[EMAIL PROTECTED]> > wrote: > > > The fact that you have used interfaces in that example proves nothing to > > me. > >> It is possible to code a solution which does not use interfaces, s

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-10 Thread Nathan Nobbe
On 10/10/07, Tony Marston <[EMAIL PROTECTED]> wrote: > > All your examples all falling on deaf ears. The fact of the matter is that > encapsulation does NOT mean data hiding, therefore I do NOT have to make > all > my member variables private. i thought we agreed to disagree on that point; im d

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-10 Thread Tony Marston
All your examples all falling on deaf ears. The fact of the matter is that encapsulation does NOT mean data hiding, therefore I do NOT have to make all my member variables private. The fact that you have used interfaces in that example proves nothing to me. It is possible to code a solution whi

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-10 Thread Nathan Nobbe
and here is the interface example youve (Tony) been asking for. the reason an interface is the best option here is because human hands and grass are not related, but they can both be cut (i didnt start the fingers thing, but it works for the example so im using it). also, notice the benefit of com

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-10 Thread Nathan Nobbe
On 10/10/07, Tony Marston <[EMAIL PROTECTED]> wrote: > > > ""Nathan Nobbe"" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > On 10/9/07, Robert Cummings <[EMAIL PROTECTED]> wrote: > >> > >> On Tue, 2007-10-09 at 21:37 -0400, Nathan Nobbe wrote: > >> > > >> > does a lawn mower not h

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-10 Thread Nathan Nobbe
On 10/10/07, Tony Marston <[EMAIL PROTECTED]> wrote: > > > ""Nathan Nobbe"" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > On 10/9/07, Tony Marston <[EMAIL PROTECTED]> wrote: > >> > >> > >> ""Nathan Nobbe"" <[EMAIL PROTECTED]> wrote in message > >> news:[EMAIL PROTECTED] > >> > O

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-10 Thread Robert Cummings
On Wed, 2007-10-10 at 14:44 +0100, Tony Marston wrote: > ""Nathan Nobbe"" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > On 10/9/07, Robert Cummings <[EMAIL PROTECTED]> wrote: > >> > >> On Tue, 2007-10-09 at 21:37 -0400, Nathan Nobbe wrote: > >> > > >> > does a lawn mower not ha

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-10 Thread Tony Marston
""Nathan Nobbe"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On 10/9/07, Robert Cummings <[EMAIL PROTECTED]> wrote: >> >> On Tue, 2007-10-09 at 21:37 -0400, Nathan Nobbe wrote: >> > >> > does a lawn mower not have blades; and gas and a control panel; does it >> not >> > have >>

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-10 Thread Tony Marston
""Nathan Nobbe"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On 10/9/07, Tony Marston <[EMAIL PROTECTED]> wrote: >> >> >> ""Nathan Nobbe"" <[EMAIL PROTECTED]> wrote in message >> news:[EMAIL PROTECTED] >> > On 10/9/07, Tony Marston <[EMAIL PROTECTED]> wrote: >> >> >> >> There's

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-10 Thread Robert Cummings
On Wed, 2007-10-10 at 08:55 -0400, tedd wrote: > At 9:54 PM -0400 10/9/07, Nathan Nobbe wrote: > > i hope i have been able to contribute something to someone > >amidst all the arguing. > > > >-nathan > > > Yeah, you gave me a better appreciation of some of the members of > this list -- we have

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-10 Thread Nathan Nobbe
On 10/10/07, tedd <[EMAIL PROTECTED]> wrote: > > At 9:54 PM -0400 10/9/07, Nathan Nobbe wrote: > > i hope i have been able to contribute something to someone > >amidst all the arguing. > > > >-nathan > > > Yeah, you gave me a better appreciation of some of the members of > this list -- we have som

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-10 Thread Tony Marston
"tedd" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > At 9:54 PM -0400 10/9/07, Nathan Nobbe wrote: >> i hope i have been able to contribute something to someone >>amidst all the arguing. >> >>-nathan > > > Yeah, you gave me a better appreciation of some of the members of this >

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-10 Thread Tony Marston
"Larry Garfield" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Tuesday 09 October 2007, Tony Marston wrote: > >> I have bought and read several books on design patterns without being >> impressed. I have seen countless examples of how particular design >> patterns >> can be im

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-10 Thread tedd
At 9:54 PM -0400 10/9/07, Nathan Nobbe wrote: i hope i have been able to contribute something to someone amidst all the arguing. -nathan Yeah, you gave me a better appreciation of some of the members of this list -- we have some smart people here (i.e., Rob, Tony, Larry). Cheers, tedd -

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-09 Thread Nathan Nobbe
On 10/9/07, Robert Cummings <[EMAIL PROTECTED]> wrote: > > On Tue, 2007-10-09 at 21:37 -0400, Nathan Nobbe wrote: > > > > does a lawn mower not have blades; and gas and a control panel; does it > not > > have > > wheels? my object modeling of a lawn mower would certainly have these > > things; > >

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-09 Thread Robert Cummings
On Tue, 2007-10-09 at 21:37 -0400, Nathan Nobbe wrote: > > does a lawn mower not have blades; and gas and a control panel; does it not > have > wheels? my object modeling of a lawn mower would certainly have these > things; > and most likely i would mark components of the engine as private. > and

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-09 Thread Nathan Nobbe
On 10/9/07, Larry Garfield <[EMAIL PROTECTED]> wrote: > > On Tuesday 09 October 2007, Tony Marston wrote: > Here's a better reason to not bother learning PHP 4-style OOP. You have > less > than a year until running PHP 4 at all is considered an unsupported > security > risk. Don't waste your time

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-09 Thread Nathan Nobbe
On 10/9/07, Larry Garfield <[EMAIL PROTECTED]> wrote: > > On Tuesday 09 October 2007, Robert Cummings wrote: > > > $sucker = new TryToViolateEncapsulation(); > > $sucker = (array)$sucker; > > > > $keys = array_keys( $sucker ); > > $sucker[reset( $keys )] = 500; > > > > $sucker = serialize( (object)

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-09 Thread Nathan Nobbe
On 10/9/07, Guillaume Theoret <[EMAIL PROTECTED]> wrote: > > On 10/9/07, Tony Marston <[EMAIL PROTECTED]> wrote: > > > > ""Nathan Nobbe"" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > > > On 10/9/07, Tony Marston <[EMAIL PROTECTED]> wrote: > > >> > > >> > > >> ""Nathan Nobbe"" <

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-09 Thread Nathan Nobbe
On 10/9/07, Tony Marston <[EMAIL PROTECTED]> wrote: > > > ""Nathan Nobbe"" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > On 10/9/07, Tony Marston <[EMAIL PROTECTED]> wrote: > >> > >> There's your problem, then. You are wasting your time trying to > implement > >> fancy design pa

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-09 Thread Nathan Nobbe
On 10/9/07, Tony Marston <[EMAIL PROTECTED]> wrote: > > > ""Nathan Nobbe"" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > On 10/9/07, Tony Marston <[EMAIL PROTECTED]> wrote: > >> > >> > >> ""Nathan Nobbe"" <[EMAIL PROTECTED]> wrote in message > >> news:[EMAIL PROTECTED] > >> > On

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-09 Thread Larry Garfield
On Tuesday 09 October 2007, Tony Marston wrote: > I have bought and read several books on design patterns without being > impressed. I have seen countless examples of how particular design patterns > can be implemented, and I am even more unimpressed. Unless you can explain, > simply and with simp

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-09 Thread Larry Garfield
On Tuesday 09 October 2007, Robert Cummings wrote: > $sucker = new TryToViolateEncapsulation(); > $sucker = (array)$sucker; > > $keys = array_keys( $sucker ); > $sucker[reset( $keys )] = 500; > > $sucker = serialize( (object)$sucker ); > $sucker = 'O:25:"TryToViolateEncapsulation"'.substr( $sucker

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-09 Thread Guillaume Theoret
On 10/9/07, Tony Marston <[EMAIL PROTECTED]> wrote: > > ""Nathan Nobbe"" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > On 10/9/07, Tony Marston <[EMAIL PROTECTED]> wrote: > >> > >> > >> ""Nathan Nobbe"" <[EMAIL PROTECTED]> wrote in message > >> news:[EMAIL PROTECTED] > >> > On 1

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-09 Thread Tony Marston
""Nathan Nobbe"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On 10/9/07, Tony Marston <[EMAIL PROTECTED]> wrote: >> >> There's your problem, then. You are wasting your time trying to implement >> fancy design patterns just because design patterns are supposed to be >> "cool". L

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-09 Thread Tony Marston
""Nathan Nobbe"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On 10/9/07, Tony Marston <[EMAIL PROTECTED]> wrote: >> >> >> ""Nathan Nobbe"" <[EMAIL PROTECTED]> wrote in message >> news:[EMAIL PROTECTED] >> > On 10/9/07, Robert Cummings <[EMAIL PROTECTED]> wrote: >> >> >> >> Why w

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-09 Thread Nathan Nobbe
On 10/9/07, Tony Marston <[EMAIL PROTECTED]> wrote: > > There's your problem, then. You are wasting your time trying to implement > fancy design patterns just because design patterns are supposed to be > "cool". Loader class, Controller Base class, Front Controller - I have > none > of that crap i

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-09 Thread Robert Cummings
On Tue, 2007-10-09 at 16:18 -0400, Robert Cummings wrote: > On Tue, 2007-10-09 at 14:11 -0400, Andrew Ballard wrote: > > On 10/9/07, Robert Cummings <[EMAIL PROTECTED]> wrote: > > > Certainly you'll notice I've extended the original class, > > > overriden the __wakeup() call and basically used inhe

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-09 Thread Robert Cummings
On Tue, 2007-10-09 at 14:11 -0400, Andrew Ballard wrote: > On 10/9/07, Robert Cummings <[EMAIL PROTECTED]> wrote: > > Certainly you'll notice I've extended the original class, > > overriden the __wakeup() call and basically used inheritance > > and polymorphism to my advantage. > > Noticed. :-) I

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-09 Thread Nathan Nobbe
On 10/9/07, Andrew Ballard <[EMAIL PROTECTED]> wrote: > > Honestly, it all seems a bit extreme. At some point, you have to trust > the people you work with not to go to such lengths to violate an > objects contract -- which I guess goes back to Tony's point whether > the language "enforces" private

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-09 Thread Andrew Ballard
On 10/9/07, Robert Cummings <[EMAIL PROTECTED]> wrote: > Certainly you'll notice I've extended the original class, > overriden the __wakeup() call and basically used inheritance > and polymorphism to my advantage. Noticed. :-) I said a *little* more difficult. Of course, I could declare the class

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-09 Thread Nathan Nobbe
On 10/9/07, Tony Marston <[EMAIL PROTECTED]> wrote: > > > ""Nathan Nobbe"" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > On 10/9/07, Robert Cummings <[EMAIL PROTECTED]> wrote: > >> > >> Why would I use an interface? :) > > > > because inheritance is not always optimal. > > I hav

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-09 Thread Tony Marston
""Nathan Nobbe"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On 10/9/07, Robert Cummings <[EMAIL PROTECTED]> wrote: >> >> Why would I use an interface? :) > > because inheritance is not always optimal. I have never found a prolem when using an interface was the only solution,

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-09 Thread Robert Cummings
On Tue, 2007-10-09 at 13:15 -0400, Nathan Nobbe wrote: > On 10/9/07, Robert Cummings <[EMAIL PROTECTED]> wrote: > > > > Why would I use an interface? :) > > > because inheritance is not always optimal. > > What's the problem that's outlined? I'm too lazy to go and look :| > > > /** > * CI_BAS

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-09 Thread Robert Cummings
On Tue, 2007-10-09 at 12:40 -0400, Andrew Ballard wrote: > On 10/9/07, Robert Cummings <[EMAIL PROTECTED]> wrote: > > $sucker = new TryToViolateEncapsulation(); > > $sucker = (array)$sucker; > > > > $keys = array_keys( $sucker ); > > $sucker[reset( $keys )] = 500; > > > > $sucker = serialize( (obje

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-09 Thread Nathan Nobbe
On 10/9/07, Robert Cummings <[EMAIL PROTECTED]> wrote: > > Why would I use an interface? :) because inheritance is not always optimal. What's the problem that's outlined? I'm too lazy to go and look :| /** * CI_BASE - For PHP 4 * * This file is used only when CodeIgniter is being run under

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-09 Thread Robert Cummings
On Tue, 2007-10-09 at 11:49 -0400, Nathan Nobbe wrote: > On 10/9/07, Robert Cummings <[EMAIL PROTECTED]> wrote: > > > > Maybe next time you'll have a challenge for me ;) > > > bravo! i expected you would come up w/ something. > > And don't whine about > > how I achieved what I did. > > > > fai

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-09 Thread Andrew Ballard
On 10/9/07, Robert Cummings <[EMAIL PROTECTED]> wrote: > $sucker = new TryToViolateEncapsulation(); > $sucker = (array)$sucker; > > $keys = array_keys( $sucker ); > $sucker[reset( $keys )] = 500; > > $sucker = serialize( (object)$sucker ); > $sucker = 'O:25:"TryToViolateEncapsulation"'.substr( $suc

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-09 Thread Tony Marston
""Nathan Nobbe"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On 10/9/07, Tony Marston <[EMAIL PROTECTED]> wrote: >> >> You are confusing member variables with local variables. Member variables >> are part of the object's data which need to be made available to the >> outside >>

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-09 Thread Robert Cummings
On Tue, 2007-10-09 at 11:41 -0400, Christoph Boget wrote: > > > > Maybe next time you'll have a challenge for me ;) And don't whine about > > how I achieved what I did. > > > Brilliant! I never would have thought of that. ;) It gets easier... here's a quick toolset for completely violating PHP5

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-09 Thread Nathan Nobbe
On 10/9/07, Robert Cummings <[EMAIL PROTECTED]> wrote: > > Maybe next time you'll have a challenge for me ;) bravo! i expected you would come up w/ something. And don't whine about > how I achieved what I did. > fair enough. maybe for your next trick youll build an interface in php4; or addr

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-09 Thread Christoph Boget
> > Maybe next time you'll have a challenge for me ;) And don't whine about > how I achieved what I did. Brilliant! I never would have thought of that. ;) thnx, Christoph

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-09 Thread Robert Cummings
On Tue, 2007-10-09 at 09:12 -0400, Nathan Nobbe wrote: > On 10/7/07, Robert Cummings <[EMAIL PROTECTED]> wrote: > > > Nothing brittle at all about PHP4 code. I can completely screw > > up any PHP5 code you send my way too. > > ok; > without modifying this class, set the value of $someInt to a value

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-09 Thread Nathan Nobbe
On 10/9/07, Tony Marston <[EMAIL PROTECTED]> wrote: > > You are confusing member variables with local variables. Member variables > are part of the object's data which need to be made available to the > outside > world. Local variables are internal to the function, and do not need to be > made avai

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-09 Thread Nathan Nobbe
On 10/9/07, Nathan Nobbe <[EMAIL PROTECTED]> wrote: > > On 10/9/07, Tony Marston <[EMAIL PROTECTED]> wrote: > > > > > > Then how come these languages still offer PUBLIC access as an option? > > > > to expose a well defined interface of course. > > -nathan > and i have a question for you, Tony; are

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-09 Thread Nathan Nobbe
On 10/9/07, Tony Marston <[EMAIL PROTECTED]> wrote: > > > Then how come these languages still offer PUBLIC access as an option? to expose a well defined interface of course. -nathan

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-09 Thread Tony Marston
""Nathan Nobbe"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On 10/7/07, Robert Cummings <[EMAIL PROTECTED]> wrote: >> >> > it just so happens i >> > have a good friend with a very strong php background who tells me >> > practically the same thing, ppp isnt that big of a deal.

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-09 Thread Nathan Nobbe
wow, this thread has blown into a massive debate about oop. well, i guess im the only one on the list who doesnt think php4 brings enough to the table with its oop offerings. the conversation has taken focus on what encapsulation is or isnt, but recall, i pointed out there are many advantages php5

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-09 Thread Nathan Nobbe
On 10/7/07, Robert Cummings <[EMAIL PROTECTED]> wrote: > > On Sun, 2007-10-07 at 11:42 +0100, Tony Marston wrote: > > > > The definition of OOP is "programming which is oriented around objects, > thus > > taking advantage of Encapsulation, Polymorphism, and Inheritance to > increase > > code reuse

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-09 Thread Nathan Nobbe
On 10/6/07, Tony Marston <[EMAIL PROTECTED]> wrote: > > Encapsulation and information hiding are separate topics. It is possible > to > have one without the other. see the revision of my php4 critique. > here are excerpts from 4 > > books, 2 on java, one on c++, and one on php: > > > > This abst

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-09 Thread Nathan Nobbe
On 10/7/07, Robert Cummings <[EMAIL PROTECTED]> wrote: > > > it just so happens i > > have a good friend with a very strong php background who tells me > > practically the same thing, ppp isnt that big of a deal. > > It isn't. i disagree. > i disagree, why, > > is it because ive had a classical

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-07 Thread Robert Cummings
On Sun, 2007-10-07 at 11:42 +0100, Tony Marston wrote: > > The definition of OOP is "programming which is oriented around objects, thus > taking advantage of Encapsulation, Polymorphism, and Inheritance to increase > code reuse and decrease code maintenance". It is possible to do this in PHP >

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-07 Thread Robert Cummings
On Sat, 2007-10-06 at 22:20 -0700, Nathan Nobbe wrote: > On 10/6/07, Robert Cummings <[EMAIL PROTECTED]> wrote: > > > > > Tony is right here. Encapsulation is about hiding the details of the > > implementation > > > rob, here is tonys definition of encapsulation: > Encapsulation is the act of pl

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-07 Thread Tony Marston
""Nathan Nobbe"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On 10/6/07, Robert Cummings <[EMAIL PROTECTED]> wrote: > >> >> Tony is right here. Encapsulation is about hiding the details of the >> implementation > > > rob, here is tonys definition of encapsulation: > Encapsulatio

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-06 Thread Nathan Nobbe
On 10/6/07, Robert Cummings <[EMAIL PROTECTED]> wrote: > > Tony is right here. Encapsulation is about hiding the details of the > implementation rob, here is tonys definition of encapsulation: Encapsulation is the act of placing data and the operations that perform on that data in the same class

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-06 Thread Robert Cummings
On Sat, 2007-10-06 at 15:42 +0100, Tony Marston wrote: > > > > OOP revolves around the concept of grouping code and data together in > > logical units called classes. This process is usually referred to as > > encapsulation, > > Correct. > > > or information hiding, > > INCORRECT > > > since i

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-06 Thread Tony Marston
""Nathan Nobbe"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On 10/3/07, Tony Marston <[EMAIL PROTECTED]> wrote: >> >> >> ""Nathan Nobbe"" <[EMAIL PROTECTED]> wrote in message >> news:[EMAIL PROTECTED] >> > On 10/3/07, Tony Marston <[EMAIL PROTECTED]> wrote: >> >> >> >> Encapsul

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-06 Thread Nathan Nobbe
On 10/3/07, Tony Marston <[EMAIL PROTECTED]> wrote: > > > ""Nathan Nobbe"" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > On 10/3/07, Tony Marston <[EMAIL PROTECTED]> wrote: > >> > >> Encapsulation is NOT data hiding. Take a look at > > > > > > please stop putting words into my m

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-03 Thread Tony Marston
""Nathan Nobbe"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On 10/3/07, Tony Marston <[EMAIL PROTECTED]> wrote: >> >> Encapsulation is NOT data hiding. Take a look at > > > please stop putting words into my mouth. i never once said encapsulation > is > data hiding. > I stated

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-03 Thread Nathan Nobbe
On 10/3/07, Tony Marston <[EMAIL PROTECTED]> wrote: > > Encapsulation is NOT data hiding. Take a look at please stop putting words into my mouth. i never once said encapsulation is data hiding. I stated PublicPrivateProctected facilitates encapsulation. tonight when i get home ill post a snipp

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-03 Thread Tony Marston
""Nathan Nobbe"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On 10/3/07, Tony Marston <[EMAIL PROTECTED]> wrote: >> >> >> Encapsulation is NOT data hiding. >> >> I repeat, encapsulation has absolutely nothing to do with data hiding. > > > http://en.wikipedia.org/wiki/Information

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-03 Thread Nathan Nobbe
On 10/3/07, Tony Marston <[EMAIL PROTECTED]> wrote: > > > Encapsulation is NOT data hiding. > > I repeat, encapsulation has absolutely nothing to do with data hiding. http://en.wikipedia.org/wiki/Information_hiding encapsulation is facilitated via ppp in object oriented programming languages.

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-03 Thread Tony Marston
""Nathan Nobbe"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > keeping data private is how encapsulation in facilitated. Absolute rubbish. Encapsulation is the act of placing data and the operations that perform on that data in the same class. The data does not have to be priva

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-03 Thread Nathan Nobbe
keeping data private is how encapsulation in facilitated. here is a really simple way to violate encapsulation in php4 class BreakMe { // private var $iWishIWasPrivate; } // later on $instance = new BreakMe(); $instance->iWishIWasPrivate = 'encapsulation violated'; if the member variable

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-03 Thread Tony Marston
""Nathan Nobbe"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > there is no way to create an abstract class in php4. Oh yes there is! I knw, because I have done it! The definition of an abstrract class is one that cannot be instantiated into an object. It can, however, be extend

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-03 Thread Nathan Nobbe
there is no way to create an abstract class in php4. in an abstract class definition subclasses are forced to implement those methods that have been declared abstract. or they are allowed to declare the method as abstract themselves and force their children to provide a concrete definition. the on

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-10-02 Thread Tony Marston
""Nathan Nobbe"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > although some people believe differently than i; i would argue > trying to learn how to design w/ the classes that php4 provides > is a waste of time. I disagree. PHP 4 gives you access to classes, encapsulation, inhe

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-09-29 Thread Nathan Nobbe
painfully i find myself bound to it at my current job. there ive been able to realize that proper oop can be used to an amazing extent in php4, however altogether i wish we could just move on to 5 and i could stop writing in // private as a comment :) -nathan On 9/30/07, Jeff Cohan <[EMAIL PROTE

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-09-29 Thread Jeff Cohan
Nathan Nobbe wrote: > > although some people believe differently than i; i would argue > trying to learn how to design w/ the classes that php4 provides > is a waste of time. most books you will find regarding object oriented > design assume the language has the basic constructs. ppp mainly. > a

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-09-29 Thread Nathan Nobbe
although some people believe differently than i; i would argue trying to learn how to design w/ the classes that php4 provides is a waste of time. most books you will find regarding object oriented design assume the language has the basic constructs. ppp mainly. also, there are other important fa

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-09-29 Thread Jeff Cohan
Instruct ICC wrote: > > From: [EMAIL PROTECTED] > > Today's post was > > prompted by my desire to prototype yet another suite of > > browse-read-edit-add-delete functions for someone. > > I was just going to ask you what is BREAD. Cool, basically a > Web-based CRUD? I can't find anything on it,

RE: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-09-29 Thread Instruct ICC
> From: [EMAIL PROTECTED] > Today's post was > prompted by my desire to prototype yet another suite of > browse-read-edit-add-delete functions for someone. I was just going to ask you what is BREAD. Cool, basically a Web-based CRUD? I can't find anything on it, can you point me to some sites?

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-09-29 Thread Jeff Cohan
Greg - Greg Maruszeczka wrote: > Jeff: > The following books really helped me get my head around basic > OOP and design patterns in PHP, especially the first one > which directly addresses both PHP4 and PHP5: > > 1. PHP Architect's Guide to PHP Design Patterns, Jason E. > Sweat, PHP Architect

Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-09-29 Thread Greg Maruszeczka
Jeff Cohan wrote: > Yes, I know how to Google, and I've been Googling... > > But I would appreciate advice about good beginner tutorials using > classes in PHP4 based on your actual experiences. I.e., have some of > you found tutorials that really unlocked the doors for you? > > Ideally, such tut