Before we get our hands dirty with menus and menu links, let's talk a bit about the general architecture behind the menu system. To this end, I want to talk a bit about its main components, what some of its key players are and what classes you should be looking at. As always, no great developer has ever relied solely on a book or documentation to figure out complex systems.
The menu system
Menus
Menus are configuration entities represented by the following class: Drupal\system\Entity\Menu. I mentioned in Chapter 1, Developing for Drupal 8, that we have something called configuration entities in Drupal 8, which we will explore in detail later in this book. However, for now, it's enough to understand that menus can...