Stereotype Annotations
Learn about different annotations that can be used in place of the generic @Component annotation and their usage.
We'll cover the following
Beans can be declared using the @Component
annotation and the <bean>
tag. But there are other ways to define beans. We will look at some of them in this lesson.
Beans can be declared using the @Bean
annotation in a configuration class or by using the
@Controller
, @Service
, and @Repository
annotations. These annotations are used at different layers of an enterprise application. A typical application has the following layers:
Level up your interview prep. Join Educative to access 80+ hands-on prep courses.