Categories
Spring Spring Core

Dependency Injection using @Inject and @Named Annotations

We have many ways to Inject Dependencies in Spring. XML Configuration, @Autowired Annotation, @Resource annotation are few of them. Among these methods we have JSR 330 Standard annotations as well. We can choose any one of these based on our application needs. Key Points : @Inject can be used instead of @Autowired and @Resource annotations […]

Categories
Spring Spring Core

Spring Annotation Based container configuration

In Spring Framework we have three different ways to configure an IoC Container. XML Based Container Configuration Bean configuration will be in the form of XML meta-data. Refer this example for better understanding. Annotation Based Container Configuration Annotations will be used to configure each bean and its properties. Java Based Container Configuration Using Java Based […]

Categories
Spring Spring Core

Stereotype Annotations in Spring and Spring Boot

The @Component, @Controller, @Service and @Repository are the Stereotype annotations of Spring and Spring Boot Instead of providing Bean Definitions in XML Configuration file Spring provides these Stereotype annotations that can be defined in Java class itself.  Spring Automatically detects Stereotyped classes and configured with the ApplicationContext. As per the above diagram, @Controller, @Service and […]