Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Doubt on chosing DAO or JPA

 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Following is the question from epractize.

You are implementing a new rich client GUI for your legacy system. The application requires to display read only data based on the search parameters.
Which of the following tech. will be used here..?

A)JSF
B)DAO
C)JPA
D)SWing
E)AWT

Answer given is A & B

I am thinking that A & C should also be better solution for this. Any anyone talk about when to choose DAO and when to choose JPA in these kind of situatinos..?
 
author and cow tipper
Posts: 5009
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My guess is that since it is a 'legacy' system, perhaps it won't support JPA?

And DAOs make it easier to port an application to a different datastore. So, if the database changes, you can make a minor change to a DAO property file, and everything gets moved over very easily.

Legacy and JPA are probably somewhat contradictory. If it's Legacy, JPA might not work?

I'm not a huge fan of the question. SCEA exam questions will tend to be clearer.

-Cameron McKenzie
 
Bartender
Posts: 6663
5
MyEclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I dont see why we cannot use JPA whether the system is legacy or not.

And DAOs make it easier to port an application to a different datastore. So, if the database changes, you can make a minor change to a DAO property file, and everything gets moved over very easily.



I would actually argue the other way around. An ORM that in turn uses JPA will make it easier to port the SQL code. DAOs can result in SQL code that is specific to the DB

I'm not a huge fan of the question



I have to agree with Cameron here. Not a very good question this.
 
Cameron Wallace McKenzie
author and cow tipper
Posts: 5009
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't disagree when Deepak disagrees with me.
 
Kumar Ala
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks...Cameron & Deepak
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

This is little confusing. I think "to display read only data" is giving little importance to DAO(Data Access Object). I do see more discussion here on JPA-DAO . http://www.infoq.com/news/2007/09/jpa-dao.
 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
From my point of view, DAO is the clear answer. While JPA implementations are working with particular data stores (most of RDBMS however), it is unlikely to deal with legacy EIS. Most probably, for the legacy system there is an API/communication protocol that can be wrapped and abstractized in a DAO implementation. DAO is much more generic and can be used both for legacy systems and for non-RDBMS systems like LDAP servers, CSV files and ANY other kind of data source. You can do this at the limit with JPA, but it will take too much time, or even can be inappropriate to map the legacy system to the JPA model. Again, with DAO you don't have these constraints
 
No thanks. We have all the government we need. This tiny ad would like you to leave now:
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic