Well it’s all disparate bits and pieces in 3.1. With plugins they just get dropped into 1 single location that we can then read from. But that’s basically all that 4.0.2 plugins do - colocate these files.
How to update pages:
How to make custom pages:
Then how you actually add functionality to any thing really, is through an initializer. See here how they add functionality to an existing class. Note that you don’t have to extend/override an existing class, initializers also allow you to add brand new classes too.