Skip to content

sandysanthosh/Spring-basics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

image

Spring Core Tutorials

Spring Framework is based on two design principles – Dependency Injection and Aspect Oriented Programming. Please go through the below tutorials to learn about the core spring concepts with implementation examples.

Spring 5

Spring 5 was released in late 2017. Spring 5 brings a massive update to the Spring framework.

Spring WebFlux

Spring WebFlux is the new module introduced in Spring 5. Spring WebFlux is the first step towards the reactive programming model in spring framework.

Spring Data JPA

Spring Data JPA is part of the Spring Data family. Spring Data makes it easier to create Spring driven applications that use new ways to access data, such as non-relational databases, map-reduction frameworks, cloud services, as well as well-advanced relational database support.

Spring Annotations

Spring Annotations A brief look at the most important annotations in spring framework.

Spring @Bean

Spring @Bean Annotation is applied on a method to specify that it returns a bean to be managed by Spring context. Spring Bean annotation is usually declared in Configuration classes methods. Spring @Service Spring @Service annotation is a specialization of @Component annotation. Spring Service annotation can be applied only to classes. It is used to mark the class as a service provider.

Spring @Component

Spring Component annotation is used to denote a class as Component. It means that the Spring framework will autodetect these classes for dependency injection when annotation-based configuration and classpath scanning is used.

Spring @RestController

Spring RestController annotation is a convenience annotation that is itself annotated with @Controller and @ResponseBody. This annotation is applied to a class to mark it as a request handler.

Spring @Controller

Spring Controller annotation is a specialization of @Component annotation. Spring Controller annotation is typically used in combination with annotated handler methods based on the RequestMapping annotation.

Spring @Repository

Spring @Repository annotation is used to indicate that the class provides the mechanism for storage, retrieval, search, update and delete operation on objects.

Spring @Configuration

Spring @Configuration annotation is part of the spring core framework. Spring Configuration annotation indicates that the class has @Bean definition methods. So Spring container can process the class and generate Spring Beans to be used in the application.

Spring @Value

Spring @Value annotation is used to assign default values to variables and method arguments. We can read spring environment variables as well as system variables using @Value annotation.

Spring @PropertySource

Spring @PropertySource annotation is used to provide properties file to Spring Environment. This annotation is used with @Configuration classes.

Spring @PostConstruct and @PreDestroy

When we annotate a method in Spring Bean with @PostConstruct annotation, it gets executed after the spring bean is initialized.

When we annotate a Spring Bean method with PreDestroy annotation, it gets called when bean instance is getting removed from the context.

Spring @Async

Spring @Async annotation allows us to create asynchronous methods in spring. Let’s explore @Async in this tutorial on spring framework.

@Postconstructor @predestroy @InitBinder

@responsebody @responseheader

@Transaction

@aspect @pointcut @jointpoint

@model @Repository @Controller @Service

@Restcontroller @RequestMapping @valid @BinderResult @configure

@getmapping @postmapping @deletemapping @putmapping

@value

@data @max,min,null,notnull, iserror