I’ve used SimpleJdbcTemplate and am comfortable with it. I also grasp (or think I do) the concept of the template method pattern
Yet I’m having some trouble putting these 2 together. How does SimpleJdbcTemplate implement this pattern exactly?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Spring’s JDBC Template (and JMS Template and lots of other templates) have NOTHING to do with Template Method.
Spring’s templates aim to reduce boilerplate codes by encapsulating them inside methods, and let users provide meaningful logic by callbacks, strategies impl etc.
Template Method is a specific design pattern that a super class define the overall flow and let subclass hook its own pieces of logic by implementing some specific methods.