Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8808349
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T02:36:00+00:00 2026-06-14T02:36:00+00:00

I am new to java programming and am trying to understand the correct way

  • 0

I am new to java programming and am trying to understand the correct way to implement the DAO design pattern. Here’s an example, I have an itemCatalog class that includes the populateItemCatalog and searchitemCatalog methods. The item catalog was implemented using an array of type item objects.

Now I want to switch to an DAO design to access the same data from an ms-access database. My question is what becomes of these methods now as the DAO is doing the searching of the database. Do I modify them to return the DTO from the DAO. Hope my question is clear. thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T02:36:01+00:00Added an answer on June 14, 2026 at 2:36 am

    As you say; now you want to fetch the same data from a different DB. Such cases DAO pattern suits ideally.

        public interface ItemCatalogDAO extends GenericDAO<DTO, String> {
       public DTO populateCatalog(String id); 
           public searchCatalog(String x);
         }
    

    Now your implementing classes will have to implement above (sample) interface. Just make sure that you design the interface in such a way that it can be used by all implementing classes.

    So as you asked can you return DTO. Yes, you should return DTO or list of DTO as per your requirement. It’s good practice to return an Object from your DAO. This way you abstract your implementation and it supports use of generics as well.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm still new to programming/Java/Android so I'm trying to understand everything I do and
I am new to thread programming in Java. To understand threading I'm trying to
new to Java programming, I am just trying to understand how I can make
hi I am new here and new in Java programming as well actually my
sry about my english :) Im new to Java programming and i have a
I have been working on Eclipse recently. I am fairly new to java programming,
I'm new to Java server programming, and I'm trying to use Google app engine.
I'm new to Java programming... I'm trying to read data from text file and
I am kind of new to Java Programming and I am trying to make
I am new to Android/java programming. I really have no clue what I am

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.