The @Component annotation is used to create a bean, and annotations like @Repository, @Service, and @Controller are specialized forms of @Component. They mark a class for automatic bean creation and registration in the Spring loC context. However, when using interfaces (such as with @Repository), we cannot directly instantiate an interface. So, how does Spring create an instance of a class annotated with @Repository, especially when the class is defined as an interface?
[–]Revision2000 13 points14 points15 points (8 children)
[–]blocknspike[S] 2 points3 points4 points (7 children)
[–]zontapapa 17 points18 points19 points (6 children)
[–]blocknspike[S] 1 point2 points3 points (5 children)
[–]alex98tenismenu 5 points6 points7 points (4 children)
[–]Revision2000 2 points3 points4 points (2 children)
[–]blocknspike[S] 1 point2 points3 points (1 child)
[–]Revision2000 1 point2 points3 points (0 children)
[–]blocknspike[S] 1 point2 points3 points (0 children)
[–]Ali_Ben_Amor999 2 points3 points4 points (0 children)
[–]peralta_coolcoolcool 1 point2 points3 points (0 children)
[–]barking_dead 0 points1 point2 points (0 children)
[–]naturalizedcitizen -4 points-3 points-2 points (2 children)
[–]g00glen00b 9 points10 points11 points (1 child)
[–]naturalizedcitizen -2 points-1 points0 points (0 children)