Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » J2EE Pattern »

EJB and/or O/R mappers?

Martin Naskovski

2003-09-11

Replies:

Hi J2EE experts/gurus,

I was wondering - what is the general feeling of people building J2EE
applications on using EJB's (or I should say session beans), in
conjunction with a DAO layer implemented with an O/R mapping
middleware tool like Hibernate? EJB CMP, obviously is not as flexible
as O/R mappers when one is dealing with, e.g. a legacy db schema that
does not conform to how a schema that would work with EJB CMP would be
designed.

I want to know - is it possible to use both, EJB & DAO (through O/R
mappers) instead of the CMP provided by the container? Is there any
benefit/disadvantage to doing this?

I keep hearing all over the place, you 'lose your distributed
features' when not using EJB, and doing it directly through DAO layer
(using O/R to implement it).

What is the deciding point a senior architect would use to make a
decision whether to use EJB or not, or just DAO w/ o/r mapping tools,
but no EJB, or maybe both???

I don't want to be dogmatized by either camp (the EJB zealots or the
DAO, O/R zealots), but I'd like more information on why or WHEN rather
to use either approach. Preferrably, if one can point me to an
analysys of why use one over the other, supplemented with some
empirical evidence from someone working on a project where he/she used
either one - would be nice... I'm also making an assumption that
whoever worked on a project like this thoroughly understands all the
J2EE patterns and has designed the application to conform to those
patterns (of course, to the extent that it applies) and/or used some
framework to achieve that.

This is the only area I have a bit of trouble making choices in
because I have heard/read so many opinions from many people on
different J2EE website, various books (by Fowler, Marinescu,
Alur/Crupi/Malks) - and I'm still confused :).

Help.

Martin
--

====================================================================
Companion Site: http://www.corej2eepatterns.com
J2EE BluePrints: http://java.sun.com/blueprints/corej2eepatterns
List Archive: http://archives.java.sun.com/archives/j2eepatterns-interest.html
Unsubscribing: email "signoff J2EEPATTERNS-INTEREST" to listserv@(protected)


©2008 junlu.com - Jax Systems, LLC, U.S.A.