joomla/joomla-platform — pull request #1057 by eddieajau (2012-03-27 22:35:19+00:00)
Title: Add optional identity to JApplicationBase; make dependency injection more flexible in JApplicationWeb

Add optional "identity" has been added to JApplicationBase. This is in preparation for being able to support applications that act as web services, or connect with other web services. The loadDispatcher method has been made public and a new loadIdentity (coupled, for now, to JUser) has been added. If the application needs either of these dependancies, it simply calls the loader. Passing no argument loads a default object but dependency injection is allowed by passing an object to the method. If neither is called, then no dispatcher or identity support is assumed.

The initialise method in JApplicationWeb has been deprecated in favour of making the loadDocument, loadLanguage and loadSession and allows for better scaling of more optional dependancies in the future. The tri-state behaviour is the same as for the loaders in JApplicationBase. No call means the object is not supported, a call without argument loads a default object and a call with an argument injects the object into the application.

All dependency loaders are chainable.