Not sure I fully understand you. I'm assuming that you mean that you prefix
each member method with a particular string that relates to the class.
By doing this you lose a key strength of OOP. Namely the ability to write
polymorphic code.

In effect, you would not be able to do the following:

class A
        {
        function print()
                {
                print("A");
                }
        }

class B
        {
        function print()
                {
                print("B");
                }
        }


$arrObjects[1]= new A();
$arrObjects[2]= new B();

foreach ($arrObjects as $key->$value)
        {
        $value->print();                // This is the polymorphic piece - the object 
type is
decided at run-time
        }


If you methods were called A_print() and B_print() then you would not be
able to build generic code as above.



-----Original Message-----
From: Scott Mebberson [mailto:[EMAIL PROTECTED]]
Sent: 09 August 2001 08:20
To: [EMAIL PROTECTED]
Subject: [PHP] I need everyones opinon!


Hi Guys,

When naming classes and function's within the class(and even
functions(probably more so?)) do you use a common string infront of
everything? For example HM_function_name()

The reason I am asking is because what if you want to easily intergrate a
class/function with lots of other classes/function and then you find out
there is two with the same name?

Any thoughts on this would be good!



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to