Reply to Re: OOP PHP with MySQLi

Your name:

Reply:


Posted by Erwin Moller on 01/31/06 19:07

Citrus wrote:

>> What a lot of overhead and such.
>> I am glad I just use global $connection; whereever I need it.
>
> Where exactly do you find any overhead ? My project will consist out of 15
> or more objects with each over 20 or 30 functions. Almost every function
> will need to use a database connection. Calling global $connection at the
> start of every script and function.. THAT is overhead.

No it is not.
That is just an opinion.
How do you want to compare? Counting?

But all is fine with me: Code whatever way feels good and structured to you.

I just do not see the advantage, but that is not important.

Don't get me wrong: I come from a Java (J2EE) background so I know my way
just fine with objects.
That is also why I like PHP so much: I can throw in objects when I need
them, where Java made me use objects for even the most simplest
functionality.
I often see people getting all happy and joyous about objects, while object
are just another way of doing what you were doing before without objects.
Smart designed functions can give you almost the same flexibility.
I just had the impression you wanted to use objects for your connection,
because that sounded cool, and I just wanted to tell you there is nothing
wrong with global $connection.

But I still wonder why you said that global $connection is bad programming.
Care to explain that?
I am just curious what made you claim that.

Regards,
Erwin Moller

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация