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

Using DAO for Part 2 Assignment:Still Relevant?

 
Rahul Mishra
Ranch Hand
Posts: 211
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

What is your general perception on injecting Entity Manager directly into Stateless Session Beans to access entities and doing away with the clutter created by DAO Factories and DAO's.

Since the message is posted in SCEA Forum , i am looking for an answer with the exam perspective and not based on real life projects.

I am actually interested to know if someone has used the Entity Manager directly from Stateless Session Bean in their solution and passed.

Thanks,
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35279
384
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes. This is an acceptable way of doing things.
 
Venkat Kantamani
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rahul,

Your approach is correct. You don't need DAO anymore for this scenario.

Regards,
Venkat
 
Rahul Mishra
Ranch Hand
Posts: 211
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But my evil twin tells me that this approach leads to entity access code being littered everywhere.

How do i convince my evil twin ? ;)
 
Alexandre Delalieu
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"i am looking for an answer with the exam perspective and not based on real life projects."

I'm not convinced that this is a good way of thinking about the exam.

I just googled and found this: http://www.infoq.com/news/2007/09/jpa-dao
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35279
384
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In real life, I wouldn't put any custom code in a session bean. I'd delegate elsewhere. You asked about the exam where it is acceptable either way. In real life, it depends.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic