? Pending

User tests: Successful: Unsuccessful:

avatar laoneo
laoneo
23 Apr 2018

Pull Request for Issue #19580.

Summary of Changes

This pr illustrates how I see the component services implemented. Through an interface the component class defines which services it provides. The base ComponentInterface contains now only the getDisptacher function as this is mandatory for every component. Like that we can introduce new services later without a BC break and do not loose any type hinting.

For every service is a trait available to avoid duplicate code amongst the other components. The following code should illustrate how such a component class will look like:

class FooComponent extends Component implements
	MVCFactoryServiceInterface,
	CategoriesServiceInterface,
	AssociationServiceInterface
{
	use MVCFactoryServiceTrait;
	use CategoriesServiceTrait;
	use AssociationServiceTrait;
}

Additionally the interface BootableExtensionInterface is added where a component class can load its internal class loader or register HTML services in a boot function:

public function boot(ContainerInterface $container)
{
	require_once 'vendor/autoload.php';

	$this->getRegistry()->register('fooicon', new Icon($container->get(SiteApplication::class)));
}

Testing Instructions

  • Create an article
  • Create a custom fields for the article
  • Open the article in the front end

Expected result

All is working as expected.

Actual result

All is working as expected.

Documentation Changes Required

Needs a bigger update on docs.

2ce8708 6 Mar 2018 avatar laoneo CS
68ca58a 10 Apr 2018 avatar laoneo CS
avatar laoneo laoneo - open - 23 Apr 2018
avatar laoneo laoneo - change - 23 Apr 2018
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 23 Apr 2018
Category Administration com_associations com_categories com_content com_fields com_menus com_tags Libraries
avatar laoneo laoneo - change - 23 Apr 2018
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - change - 23 Apr 2018
Category Administration com_associations com_categories com_content com_fields com_menus com_tags Libraries Administration com_associations com_categories com_content com_fields com_menus com_tags Front End Libraries
avatar wilsonge
wilsonge - comment - 6 May 2018

Not 100% convinced by the loadHelper method - but this is definitely a massive improvement on what we have now - so will merge :) Thanks for much for the patience on this

avatar wilsonge wilsonge - change - 6 May 2018
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2018-05-06 17:23:43
Closed_By wilsonge
avatar wilsonge wilsonge - close - 6 May 2018
avatar wilsonge wilsonge - merge - 6 May 2018

Add a Comment

Login with GitHub to post a comment