Solved

DAO method return types

Posted on 2011-09-10
4
451 Views
Last Modified: 2012-05-12
I would like to know about DAO layer. Waht are the return types of those methods. Where, how, why we use this layer. Advantage, disadvantage. I am not clear on this concept. thank in advance
0
Comment
Question by:gudii9
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 3

Accepted Solution

by:
evedder earned 250 total points
ID: 36517886
the DAO layer is conceptual you have to define your classes so the type those method returns depends on you, but the idea is to have these classes that act like a pass through your application and the data i mean they are the key to get your info, so you can separate your application logic from the data access. This data can be in a database, text files, etc.
0
 
LVL 3

Expert Comment

by:evedder
ID: 36517890
0
 
LVL 1

Assisted Solution

by:vakorde
vakorde earned 250 total points
ID: 36520817
The concept of layer came into picture to separate the complexity of a particular area. The change in a layer should impact only the adjoining layers.  
If we are talking about DAO, this is built to separate the Database access complexity. There are many different types of databases like CSV file, XML file, Relational, etc. Each of these will have their own mechanism to extract required data. The DAO layer makes sure that even if we changes the database it should not impact the adjoining layer (generally business layer). We just need to do the changes in DAO layer.
To achieve this we must use the POJO objects to communicate data between layers.
To answer your question, the return type should be a POJO. It can be Map, List, String basis on your requirement but it must be a Plain Old Java Object (POJO).
0
 
LVL 7

Author Comment

by:gudii9
ID: 36636131
>>>To answer your question, the return type should be a POJO

can we return POJO. How to return a POJO. Can you please point me to simple example
0

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

635 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question