$app = JFactory::getApplication();
$model = $app->get('ModelName');
$session = $app->getSession();The JFactory class is part of the Joomla Core Framework package library, which is a set of methods and functions that enable developers to create Joomla extensions and customise the Joomla platform.