Link to home
Start Free TrialLog in
Avatar of gudii9
gudii9Flag for United States of America

asked on

spring DAO

I was reading folowing lines and I did not understand clearly.
>>
But at certain points, the process delegates to other collaborators to fill in
some implementation-specific details. This is the part of the process that is variable.
For example, the handling of luggage starts with a passenger checking in
the luggage at the counter. This part of the process always has to happen at the
beginning, so its sequence in the process is fixed. But each passenger’s luggage
check-in is different. The implementation of this process is determined by the
passenger. In software terms, a template method delegates the implementationspecific
portions of the process to an interface. Different implementations of this
interface define specific implementations of this portion of the process.
Spring applies this pattern to data access. No matter what technology we are
using, certain data access steps are required. For example, we always need to
obtain a connection to our data store and clean up resources when we are done.
These are the fixed steps in a data access process. But each data access implementation
we write is slightly different. We query for different objects and update the
data in different ways. These are the variable steps in a data access process.
Spring separates the fixed and variant parts of the data access process into


Any ideas, resources,sample code,links, highly appreciated. thanks in advance.
ASKER CERTIFIED SOLUTION
Avatar of for_yan
for_yan
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gudii9

ASKER

>>> In software terms, a template method delegates the implementationspecific
portions of the process to an interface.

template means jdbc template right.  Which method delegates it. please advise

In Object Oriented Design (see, e.g. http://www.oodesign.com/template-method-pattern.html)
 we speak
of template as say some general higher level plan of a procedure where each individual
step may be implemeneted sperarately in different way.
In JDBC, well , we can also on certain level think of the template - say to get some piece
of data - you have to first make a connection, then locate adequate table, locate adequate row,
find value of necessary field, return data - these are indeed steps defined by jdbc pattern, assumption of how it should
proceed which underlies jdbc
- this may be called as template and implementation of each step is delegated to
driver and each driver will implemnet each step in its own  way, though they will all
follow the same template imposed by jdbc.
SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial