How to properly subclass a Widget

Are there any instructions on how to properly subclass a Widget? I’m wondering how I should be using the protected methods i.e., in the way they were intended to be used.