In addition to what DarwkwingDuck said, I will just mention that RoleEntryPoint Provides methods to run code when a role instance is initialized, run, and stopped.
If we continue to read through the RoleEntryPoint class documentation on MSDN we will also see the following:
Worker roles must extend the RoleEntryPoint class to add functionality
to the role instances. Web roles can optionally extend the
RoleEntryPoint class, or can use the ASP.NET lifecycle management
methods to handle the start and stop sequences. For a VM role, Windows
Services are used instead of the RoleEntryPoint class.
So, Web roles can optionally extend the RoleEntryPoint class.