Advice
is the implementation of the cross-cutting
functionality. An Adivce
provides the code for implementation of the service.
There are four types of Advice:
- Before Advice
- After Advice
- Around Advice
- Throws Advice
Advice
is the implementation of the cross-cutting
functionality. An Adivce
provides the code for implementation of the service.
There are four types of Advice:
As we know the Aspect
is just the name of the cross-cutting
functionality, not the implementation. So what’s the implementation of the cross-cutting
functionality? It’s called Advice
. An Advice
provides the code for implementation of the service. It is like Logging service, Logging is a Aspect
and Advice
denotes the implementation of Log4j.
An Aspect
represent the name of a cross-cutting
functionality, it’s only name not implementation.
Let us see the example.
1 | public class MyLogicClass |
What is AOP
?, AOP
stand for Aspect Oriented Programming
. It’s very important module for Spring
framework. In the enterprise level application programming we used to add different types of services to our application at runtime automatically, like logging, email, transaction, authentication services. These actions we called cross-cutting
functionalities. AOP
do this job.
As we know, we can use jdbc
to access database in java programming. And now let us use jdbc
in spring. The spring framework
reduces developer handlers any accessing database exception, because it deal with them internally. The spring framework integrated the jdbctemplate, they are org.springframework.jdbc.datasource.DriverManagerDataSource
and org.springframework.jdbc.core.JdbcTemplate
.
And here we use the hsqldb
to act as our memory database. You can go to here to look at it. we use the Maven
tools to management our project. the dependencies is: