6.0.0-git
2024-04-26
Last Modified 2006-08-15 by Jan Schneider

This should be a general landing page for thoughts on and debate about removing globals.

Should we refactor to remove all global variables and other couplings with global state ($_SESSION, $_REQUEST, singleton pattern, etc)? We can do this by:

  • Encapsulting request in a request object
    • Instantiate master Horde object (e.g. $horde = new Horde($config);)
    • InstantiateApplicationObjectRefactoring
    • Page handling become method object (e.g. $page = new Turba_BrowsePage($app, $request); $page->execute();)

--Jason


  • Instantiation of the Horde object doesn't make sense to me because it introduces another global object. And why is using a static Horde class bad?
    • Usage of $_SESSION makes a lot of sense to me, because it is very clear that we are dealing with session state. Encapsulating this in a class or object obfuscates the code.

--Jan