How to cononically register a user backend in Nextcloud 20?

I have been reading the documentation on the new IBootstrap but it does not mention registering a user backend.

My solution until now was to register in the constructor of Application.php (full source):

    $userBackendSqlRaw = $context->get(\OCA\UserBackendSqlRaw\UserBackend::class);

    \OC::$server->getUserManager()->registerBackend($userBackendSqlRaw);

AFAIU a user manager should be registered in register(). My boot() remains empty.

  1. Am I correct in assuming that a user backend should be registered in register()?

  2. getUserManager() is deprecated but I did not find any documentation naming a successor. A app update guide says that I should

    have the interface injected instead

    What does this mean?

  3. Is there anything I need to put in boot() that would not be obvious?

I think I got it now. Would appreciate some feedback.

@MorrisJobke If you have time, could you give your blessing? As I found no concrete example in the documentation, this is a work of deduction and skimming through other code.