| Author |
Doubt on chosing DAO or JPA
|
Kumar Ala
Ranch Hand
Joined: Apr 30, 2009
Posts: 53
|
|
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..?
|
kumar
SCEA5 P1
|
 |
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Joined: Aug 26, 2006
Posts: 4962
|
|
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
|
Author of Hibernate Made Easy, What is WebSphere???, JSF 2.0 Made Easy and the SCJA Certification Guides
|
 |
Deepak Bala
Bartender
Joined: Feb 24, 2006
Posts: 6371
|
|
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.
|
SCJP 6 articles - SCJP 5/6 mock exams - SCJP Mocks - SCJP 5 Mock exam (Word document ) - SCJP 5 Mock exam in Java.Inquisition format
|
 |
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Joined: Aug 26, 2006
Posts: 4962
|
|
I don't disagree when Deepak disagrees with me.
|
 |
Kumar Ala
Ranch Hand
Joined: Apr 30, 2009
Posts: 53
|
|
|
Thanks...Cameron & Deepak
|
 |
Madhavilatha Yeduguri
Greenhorn
Joined: Dec 09, 2009
Posts: 4
|
|
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
Joined: Mar 13, 2008
Posts: 14
|
|
|
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
|
 |
 |
|
|
subject: Doubt on chosing DAO or JPA
|
|
|