Class-Level Event Handlers

I read a documentation about Class-Level Event Handlers but is not clear for me how and where to use if is necessary to create a component if not witch is a rigth way to do help me please.