Java Reference
In-Depth Information
Spring TransactionInterceptor
<<interface>>
TransferFacade
TransferResult transfer(fromId, toId, amount)
TransferFacadeImpl
TransferResult transfer(fromId, toId, amount)
TransferService
TransferResult
BankingTransaction transfer(fromId, toId, amount)
Account
<<interface>>
BankingTransaction
Repository
<<interface>>
Account
Repository
Banking
Transaction
debit(amount)
credit(amount)
createTransaction(... )
findAccount(id)
<<interface>>
OverdraftPolicy
HibernateBanking
Transaction
Repository
Hibernate
Account
Repository
findAccount(id)
createTransaction(... )
NoOverdraft
Policy
Limited
Overdraft
Hibernate
Figure 1.8
Money transfer service implemented with POJOs, Hibernate, and Spring
I have omitted some of the details, but I hope you can see what you can accomplish
with POJO s and lightweight frameworks such as Spring. By using Spring, we have
the functionality we formerly needed from the EJB container. By using POJO s, we
also have a design and structure of code that is impossible if we use the heavyweight
J2EE application server and all its services. Using the lighter weight tools allows us
to improve the structure, maintainability, and testability of our code.
 
Search WWH ::




Custom Search