Manager Classes: Spring-Hibernate IntegrationIn Chapter 10, "Beyond the Basics," we discussed the Spring and Hibernate integration. By leveraging and using Spring's declarative transaction management support, we were able to reduce the lines of code in our Manager classes significantly. The refactored code can be found under the rapidjava/timex2/ directory. For example, the following is the original method in our TimesheetManager class (found in timex/) to save a Timesheet object: public void saveTimesheet(Timesheet timesheet) This code was reduced to just one line! The new saveTimesheet method can be found under timex2/ and looks like this: public void saveTimesheet(Timesheet timesheet) |
Tuesday, November 3, 2009
Manager Classes: Spring-Hibernate Integration
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment