Understanding the Application classes
From Joomla! Documentation
A Joomla! CMS installation consists of several Applications:
- Site, also known as the Frontend.
- Administrator, also known as the Backend. It is here that you can make major customisations for your site or Frontend. You can set up how your template looks or you can add new extensions such as components, languages, modules, plugins and templates from the Joomla! Extensions Directory (JED).
- Installer is an application that helps you to install and configure Joomla on your website. Follow the next steps at Installer. This application should be deleted as soon as installation is completed.
The main applications are Administrator, Site, and Installation. Each application extends the abstract base class \\Joomla\\Application\\AbstractApplication with objects JApplicationAdministrator, JApplicationSite, and InstallationApplicationWeb respectively.
Joomla Framework Abstract Application | | |---> Base Application (adds some CMS Specific functions) | | |---> Web Application (adds some generic web application functions) | | | | | |---> JApplicationCms (things specific for running the CMS) | | | |---> JApplicationAdministrator | | | |---> JApplicationSite | | | |---> InstallationApplicationWeb | | |---> CLI Application | | |---> Daemon Application
You can always obtain the a reference to the Application object currently being run by simply using the code.
$app = JFactory::getApplication(); and it is an object of type JApplicationAdministrator, JApplicationSite or InstallationApplicationWeb depending on the application currently running.
This provides an easy way for extensions to reference global application properties and methods without having to be concerned with which Application object is currently being referenced. When a component is operating in the backend, <source lang="php" inline>JFactory::getApplication() will be pointing to the JApplicationAdministrator object. When a component is operating in the frontend, <source lang="php" inline>JFactory::getApplication() will be pointing to the JApplicationSite Application object.
Command Line Applications
As you can see we've covered the 3 application's that cover all the usage of the website your use in your browser. However Joomla can also cover more than this - it can also deal with CLI Applications. People building their own CLI Applications need to extend the Joomla Abstract CLI Application JApplicationCli that is found in the CMS. You can find examples of these in the CLI directory of your Joomla installation.
People can also run daemon processes in Joomla by using the JApplicationDaemon class.