[PHP] class effeciency

2002-02-28 Thread Nick Wilson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi all, I have an application that spits out a contact form in either English or Danish. Someone suggested I use a 'class factory' like the PEAR db abstraction layer and that is what I'm doing. So I choose the language like this: $form = Form::GetFo

Re: [PHP] class effeciency

2002-02-28 Thread S.Murali Krishna
Hi I too suggested a way for your previous problem. What you are doing is right here, but some corrections are there. You cannot use 'var' to declare variables inside constructors rather you could use them only before constructor, and intialize them inside constructor, look out the be

Re: [PHP] class effeciency

2002-02-28 Thread Nick Wilson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * and then S.Murali Krishna declared > > Hi > I too suggested a way for your previous problem. > What you are doing is right here, but some corrections are there. > > You cannot use 'var' to declare variables inside constructors > rath

Re: [PHP] class effeciency

2002-02-28 Thread Simon Willison
Nick Wilson wrote: >Is there a better way? It just seems like overkill to include 6-700 >lines of methods /twice/ > Use inheritance. Define a "base" class with all of the methods in it. Then define the two other classes to extend this base class, meaning they will have all of the methods you ha

Re: [PHP] class effeciency

2002-02-28 Thread Nick Wilson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * and then Simon Willison declared > Nick Wilson wrote: > > >Is there a better way? It just seems like overkill to include 6-700 > >lines of methods /twice/ > > > Use inheritance. Define a "base" class with all of the methods in it. > Then defi

Re: [PHP] class effeciency

2002-02-28 Thread Mika Tuupola
On Thu, 28 Feb 2002, Nick Wilson wrote: > It is only the *properties* that are different in each language class > not the methods so I'm including all the same methods twice! That > doesn't seem terribly efficient. There is no need to rewrite the methods. See: http://www.php.net