By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,778 Members | 1,083 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,778 IT Pros & Developers. It's quick & easy.

Question about implementing Data Access Object design pattern

P: n/a
I'm developing a J2EE aplication and the project leader told me to
investigate about the Data Access Object design pattern. I did some
research at Sun's blueprints for the enterprise site but there are
some things that I seem to be missing...
My main problem is... If I'm using classes to access data why do I
still need to use EJB's?? Would anyone please point me to some source
code about it???

Thanks in advance and sorry if I misspelled something (English is not
my mother language).
Jul 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
mr********@yahoo.com (Yoandy Rodriguez) wrote in message news:<64*************************@posting.google.c om>...
I'm developing a J2EE aplication and the project leader told me to
investigate about the Data Access Object design pattern. I did some
research at Sun's blueprints for the enterprise site but there are
some things that I seem to be missing...
My main problem is... If I'm using classes to access data why do I
still need to use EJB's?? Would anyone please point me to some source
code about it???

Thanks in advance and sorry if I misspelled something (English is not
my mother language).

You could start your study from them comments:
http://www.theserverside.com/news/th...hread_id=23250
Jul 17 '05 #2

P: n/a
mr********@yahoo.com (Yoandy Rodriguez) wrote in message
My main problem is... If I'm using classes to access data why do I
still need to use EJB's?? Would anyone please point me to some source
code about it???


Assuming you have some multi-threaded, scalable infrastructure that
can handle requests (e.g. servlets) then theoretically you don't need
to use EJBs at all.

However EJBs are not just a means of accessing databases, they are
there to abstract your business services and to provide scalability,
transactions, etc. within an application container.

The fact that your team-lead has suggested using DAOs within your EJBs
doesn't change this. All the DAO pattern does is separate data-access
code (e.g. JDBC) from business logic code (i.e. the EJBs) - it's a
basic abstraction.

- sarge
Jul 17 '05 #3

P: n/a
Here is some example source code :

http://www.javapractices.com/Topic66.cjp

Yoandy Rodriguez wrote:
I'm developing a J2EE aplication and the project leader told me to
investigate about the Data Access Object design pattern. I did some
research at Sun's blueprints for the enterprise site but there are
some things that I seem to be missing...
My main problem is... If I'm using classes to access data why do I
still need to use EJB's?? Would anyone please point me to some source
code about it???

Thanks in advance and sorry if I misspelled something (English is not
my mother language).


Jul 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.