View Single Post
  #9  
Old 5th November 2009, 18:59
osmoza osmoza is offline
Junior Member
 
Join Date: Nov 2009
Posts: 5
Thanks: 0
Thanked 4 Times in 3 Posts
Default

OK, but why not using something like Application::getApplication() - method that returns application object?

For (backward) comatibility you could use it as:
PHP Code:
public function foo()
{
    
$app Application::getApplication();
   
$app->db->query(....);
    .....

Same thing with "global $config" - global in methods seams less OOP for me. One have no idea what global $app/$config is and where to look for it. With Application::getApplication() - you can "RMB > Navigate to source" and get all the information needed.

You could also copy-paste Application class with DB class only and have all the functionality both of them provide. With global $app - one have no idea what to copy and how to call it (how to instantiate $app, where to do it, and so on..).

Oh, and FYI: I'm not dissing your work! Ispconfig saved me houndreds of hours of developing - I love it!

I'm asking about design decission - the above is in my opinion beter approach, but I might be wrong.

Cheers,
O.
Reply With Quote