From the course: Spring: Framework in Depth
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Challenge: Building your own aspect
From the course: Spring: Framework in Depth
Challenge: Building your own aspect
(pleasant electronic music) - [Instructor] So now it's time for a challenge exercise and you're going to get to write your own aspect. Let's take a look at the challenge as a whole. So what I want you to do is create a counter, and that counter will count all method calls so all calls to an individual method. I want you to report on them by method name and then apply the counter at method level, and you can apply it to any number of methods you pick, one of your methods, all of your methods, that's totally up to you, but what I want you to do is make sure that you're counting each time the method is called in the application and then report it, so name, colon, number of times it's been called, and continually output that every time it's called. Give you a few minutes, and I'll be back with you.
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
Aspecting in Spring4m 51s
-
(Locked)
Define aspect-oriented programming (AOP) pointcuts6m 6s
-
(Locked)
Implement AOP advice: Before5m 9s
-
(Locked)
Implement AOP advice: After2m 40s
-
(Locked)
Implement AOP advice: Around4m 40s
-
(Locked)
Challenge: Building your own aspect53s
-
(Locked)
Solution: Building your own aspect2m 41s
-
-