October 2017
Intermediate to advanced
396 pages
10h 2m
English
As you know that, Spring AOP is proxy-based. It mean Spring creates the proxy to weave the aspect between the business logic that is, in target object. It is based on the Proxy and Decorator design pattern. Let's see TransferServiceImpl class as an implementation of TransferService interface:
package com.packt.patterninspring.chapter6.bankapp.service;
import org.springframework.stereotype.Service;
public class TransferServiceImpl implements TransferService {
@Override
public void transfer(String accountA, String accountB, Long amount) {
System.out.println(amount+" Amount has been tranfered from "+accountA+" to "+accountB);
}
}
Caller invokes this service (transfer() method) directly by the object reference, let's ...
Read now
Unlock full access