Notes - Spring Boot
Notes - Spring Boot
@ComponentScan
The main() method calls a static run() method on the SpringApplication class which
creates the Spring application context. The two parameters passed to the run()
method are a configuration class and the command-line arguments
Or
./mvnw spring-boot:run
@SpringBootTest --> tells JUnit to bootstrap the test with Spring Boot capabilities
@WebMvcTest --> arranges for the test to run in the context of a Spring MVC
application.
before Spring hands the request over to a view, it copies the model data into
request attributes that Thymeleaf and other view-templating options have ready
access to.
Terminologies:
Advice:- the job of an aspect is called advice. defines both the what and the
when of an aspect
Before,After,After-returning,After-throwing,Around
Join Points :- points where your aspect’s code can be inserted into the
normal flow of
your application to add new behaviour. This point could be a method being
called, an exception being thrown, or even a field being modified
Point Cuts :- pointcut definition matches one or more join points at which
advice should be woven. If advice defines the what and when of aspects, then
pointcuts define the where.
Aspects :- merger of advice and pointcuts
Introductions :- allows you to add new methods or attributes to existing
classes
Weaving :- process of applying aspects to a target object to create a new
proxied
object. Can take place at Compile time, Class load time, Runtime