What is exactly the difference between:

$model = \JModelLegacy::getInstance('Objects', 'MyModel');


$model = BaseDatabaseModel::getInstance('Objects', 'MyModel');

Is there some performance differences? Is one of them getting removed earlier in Joomla 5? The communcation and documentation around the Joomla Framework is bad.

I cannot do this yet so please dont suggest:

$model = $component->getMVCFactory()->createModel($modelName, $this->app->getName(), ['ignore_request' => true]);

1 Answer 1


JModelLegacy is now just an alias of BaseDatabaseModel to support older references to JModelLegacy therefore there is no difference at all between either statement.

JLoader::registerAlias('JModelLegacy', '\\Joomla\\CMS\\MVC\\Model\\BaseDatabaseModel', '6.0');

The createModel() function in the LegacyFactory class, not the createModel() method you have shown above from MVCFactory, also uses BaseDatabaseModel::getInstance

  • OK. And will one of them dissapear in Joomla 5 first or will they both be kept for supporting deprecated stuff?
    – maidan
    Aug 16 at 8:31
  • JModelLegacy will be removed in 5. It has been depreciated for some time already.
    – Irata
    Aug 16 at 10:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.