What is the purpose of docRegistry.addWidgetExtension, could i bypass it?

Hello all,
jupyterlab extension guide has a example that add custom widget in header

export class WidgetExtension
  implements DocumentRegistry.IWidgetExtension<NotebookPanel, INotebookModel>
{
  createNew(
    panel: NotebookPanel,
    context: DocumentRegistry.IContext<INotebookModel>
  ): IDisposable {
    const widget = new Widget({ node: Private.createNode() });
    widget.addClass('jp-myextension-myheader');

    panel.contentHeader.insertWidget(0, widget);
    return new DisposableDelegate(() => {
      widget.dispose();
    });
  }
}

function activate(app: JupyterFrontEnd): void {
  app.docRegistry.addWidgetExtension('Notebook', new WidgetExtension());
}

docRegistry is really abstract and unfamiliar to me, and don’t know its usage .
My question is, if notebook panel is easy to get, why not operate panel directly, such as

activate(app, notebookTracker) {
    notebookTracker.some_xxx_signal.connect((tracker, panel) => {
        panel.contentHeader.insertWidget(...)
    } );
}

Is it more simple and straightforward?