This content may be out-of-date

This book was written circa 2022, when Joomla 4 was still a new thing. It has not been updated for Joomla 5 and beyond, and it's no longer being worked on. You can usually find more up-to-date information in the official Joomla! Manual.

Using your extension class in the service provider

As you remember from the service provider section, in Part 2.a you need to instantiate the extension class. These lines would look like this:

$component = new \Acme\Component\Example\Administrator\Extension\ExampleComponent(
  $container->get(ComponentDispatcherFactoryInterface::class)
);

Simple, isn't it?