Recall & Review
beginner
What is a pointcut expression in Spring AOP?
A pointcut expression defines where advice should be applied by matching method executions or join points in the code.
Click to reveal answer
beginner
Explain the use of the
execution() designator in pointcut expressions.The
execution() designator matches method executions based on method signature patterns like return type, method name, and parameters.Click to reveal answer
intermediate
What does the pointcut expression
execution(* com.example.service.*.*(..)) mean?It matches the execution of any method with any return type, in any class inside the <code>com.example.service</code> package, with any number of arguments.Click to reveal answer
intermediate
How can you combine multiple pointcut expressions?
You can combine pointcuts using logical operators like
&& (and), || (or), and ! (not) to create complex matching rules.Click to reveal answer
beginner
What is the role of wildcards (*) and double dots (..) in pointcut expressions?
The wildcard
* matches any single part like a method name or type, while .. matches any number of parameters or sub-packages.Click to reveal answer
Which pointcut designator matches method executions by signature?
✗ Incorrect
The execution() designator matches method executions based on method signatures.
What does the wildcard * represent in a pointcut expression?
✗ Incorrect
The * wildcard matches any single part such as a method name or type.
How do you exclude a pointcut from another using logical operators?
✗ Incorrect
The ! operator negates a pointcut, effectively excluding it.
Which expression matches all methods in a package and its sub-packages?
✗ Incorrect
The double dot .. matches sub-packages, so com.example..* includes all sub-packages.
What does
execution(public * *(..)) match?✗ Incorrect
It matches any public method regardless of return type or parameters.
Describe how pointcut expressions help in applying advice in Spring AOP.
Think about how you tell Spring where to run extra code.
You got /3 concepts.
Explain the difference between the wildcards * and .. in pointcut expressions.
One is for single parts, the other for multiple parts.
You got /2 concepts.