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.

Solution: Building your own aspect

Solution: Building your own aspect

From the course: Spring: Framework in Depth

Start my 1-month free trial

Solution: Building your own aspect

(upbeat music) - [Instructor] Now that you have had your chance, it's time forme to show you my solution to this challenge exercise. I choose to solve this aspect through an annotation. I created an annotation called countable and I created a corresponding aspect for it. So, I created a logger called LIL Application Counter for LinkedIn Learning Application Counter. I created an internal map element aspect to hold both the method name and an integer for the number of times it was counted. And that's on line 20. I then created my point cut, which looked for that annotation countable on line 22. Then, I went ahead and did a before on this one because all I care about is that the method was called. There was no requirements about that it returned, it returned data. None of that mattered. So, what I care about is that it was called. And I just want to simply get the name of it. And I'm building the name in such a way…

Contents