This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doubt on chosing DAO or JPA

 
Kumar Ala
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • 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..?
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • 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
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • 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
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Thanks...Cameron & Deepak
 
Madhavilatha Yeduguri
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • 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.
 
emanuel petre
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic