A typical component contains four classes:
Service interface—This defines the contracts for the service implementation class and serves as a property type for the bean implementation class.
Service implementation—This implements service interface class.
Bean interface—This sets properties for the bean implementation class.
Bean implementation—This implements the bean interface and calls the methods of the service implementation class.