Advertisement

04.24.2008 at 10:10AM PDT, ID: 23351052
[x]
Attachment Details

Interfaces with DAO

Asked by CIPL-Senthil in Open Source Programming, Java Programming Language, Jakarta Struts

Hi Experts,

I am working on an STRUTS based web application.

I have a doubt about the flow being followed in the project design to access the Data. The flow goes as below:

Action Class ==[calls]==> DAO ==[Access Database]

My question is, for every DAOs such as EmpDAO, SalaryDAO etc., There are methods pertaining to the DAOs. For instance, In EmpDAO, say I am having getEmployeeDetails() method and in SalaryDAO, I am having getSalaryDetails() method.

For all the methods implemented in a particular DAO, are specified in an INTERFACE and the same is implemented in the respective DAOs.

For instance, the getEmployeeDetails() is defined in an interface EmpInterface, which has the getEmployeeDetails() method declared in it and the interface is implemented in the EmpDAO. The same is repeated for each and every DAOs.

In the ACTION class, the code goes like this:

EmpInterface intEmp = new EmpDAO();
intEmp.getEmployeeDetails() ;

I would like to know, "Is there any advantage of having an interface which holds all the methods used in the DAO?"

Please advice.

Thanks & Regards,
Madhu Manikandan, RStart Free Trial
[+][-]04.25.2008 at 01:16AM PDT, ID: 21437731

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.25.2008 at 06:01AM PDT, ID: 21439035

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.25.2008 at 08:31AM PDT, ID: 21440541

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.25.2008 at 01:53PM PDT, ID: 21443125

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Open Source Programming, Java Programming Language, Jakarta Struts
Sign Up Now!
Solution Provided By: girionis
Participating Experts: 2
Solution Grade: C
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628