Spring Boot - Aspect-Oriented Programming
Consider the following Spring AOP aspect:
What will be printed when
@Aspect
@Component
public class AuditAspect {
@Before("execution(* com.example.service.OrderService.placeOrder(..))")
public void audit() {
System.out.println("Audit: Order placement started");
}
}
@Service
public class OrderService {
public void placeOrder() {
System.out.println("Order placed");
}
}What will be printed when
orderService.placeOrder() is called?