Spring Tutorial 30 - JoinPoints and Advice Arguments

preview_player
Показать описание
We'll now learn about join points, and how we can use arguments in the advice methods to get information about join points.
Рекомендации по теме
Комментарии
Автор

I wonder what the guy who came up with AOP was thinking when he came up with such weird terms: pointcut, advice, joinpoint, etc.

scraper
Автор

What an excellent introduction into AOP! I'd heard about AOP before but didn't have any clue what was that thing about until I needed to call a method before each method of a class is called in my Spring app. Glad I ended up on this playlist, AOP ain't that scary anymore. :-) Thanks for sharing knowledge.

roman_mf
Автор

Really Amazing Explanation Sir.
Best Teacher in Software Sir.

thanks a lot.

shilpag
Автор

Nice tutorial series. I am learning Spring and usually refer a book, but whenever I am stuck the series really helps me.

kumarsantoshdash
Автор

Thank you very much for such a wonderful tutorial Koushik...I am waiting eagerly for next uploads from you on this series...I hope you have plan to cover the remaining sections (Spring MVC, Spring hibernate, Spring JDBC etc) of Spring as well.

atulkmishraji
Автор

hi sir, when am using Aspect annotation it is creating error .I used the same code which you explained in your videos
Error creating bean with name 'circle' defined in class path resource [SpringAop.xml]: Initialization of bean failed; nested exception is
i have been working on it and not resolving.could you please help

RamyachowdaryUdathaneni
Автор

I have a below query for fellow programmers:
(I know its kind of a bit destructive coding, but wanted to try out anyways)


public void circleAllMethods() {}

@Before("circleAllMethods()")
public void LoggingAdvice(JoinPoint joinPoint) {
//System.out.println("Aspect method LoggingAdvice() called. " + joinPoint.toString());
Circle cir = (Circle) joinPoint.getTarget();
cir.setName("Dummy Name");
System.out.println("Aspect method LoggingAdvice() called. " + joinPoint.toString());
System.out.println("Exiting from Advice");

}


For all the Circle class methods, I created this advise should execute. But when I get the handle and set the name, it should again trigger this advice which should again setName, and keep repeating - however, it doesn't I just get the below response:

Aspect method LoggingAdvice() called. execution(String
Exiting from Advice
Dummy Name


Why it won't call the advise again?

reachmanav
Автор

Can we apply Advice Argument for any specific packages classes or for set of different classes?
If yes, thenhow?

Thanks,
Vineet

vineetvideos
Автор

i have a doubt...a real silly one
why are we using setName separate in the main method at 9:04. Doesn't using <property> tag in the spring.xml invoke the setter and assign value to the variable "name"?

amulkumar
Автор

i' m getting a stackoverflow error trying to print sth in the method annotated with @Before("args(String)") although my code is identical to the one in the tutorial. i' d appreciate it if any one explained why this is happening.

vovyklembergsohn
Автор

Hi, it seems my reply is too late, but i recommend to take a look at Grails framework, it's based on Spring and hibernate, and you will understand it especially after these tutorials
many thanks @koushks

raghebadel