You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Sasha Borodin <sa...@whoissasha.com> on 2003/10/03 21:09:38 UTC
EJB's vs. Hibernate vs. Torque vs. custom DTO's
I hope I'm not comparing apples and oranges; if I am, please excuse the
ignorance, and slap me upside the head...
The subject line says it all - I'm investigating the appropriate uses of the
above technologies to move data between databases and objects. Thus far in
my development career, I've relied on my own DTO's - homegrown primitive
lazy loading, caching, etc.
As I'm starting projects for other companies, I'm realizing that no one
wants home-grown solutions where standards and proven products have already
filled the niche.
Thus, I'd like to get some opinions as to the level of complexity and
appropriate use of EJBs and other object-relational bridging technologies.
Who uses what, why, and where? :-)
-Sasha Borodin
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: EJB's vs. Hibernate vs. Torque vs. custom DTO's
Posted by Vic Cekvenic <ce...@basebeans.com>.
> Joe Germuska wrote:
>
>> I'm interested in the rapidly developing "microkernel" field
>> (HiveMind, Keel, PicoContainer, Spring...) but haven't made the time
>> to choose one of them.
>
A vote for Pico from me.
.V
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: EJB's vs. Hibernate vs. Torque vs. custom DTO's
Posted by Ted Husted <hu...@apache.org>.
Joe Germuska wrote:
> I'm interested in the rapidly developing "microkernel" field (HiveMind,
> Keel, PicoContainer, Spring...) but haven't made the time to choose one
> of them.
My own wild guess would be that HiveMind will be the next Maven ... You
will be assimilated :)
-Ted.
--
Ted Husted,
Junit in Action - <http://www.manning.com/massol/>,
Struts in Action - <http://husted.com/struts/book.html>,
JSP Site Design - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.
"Get Ready, We're Moving Out!!" - <http://www.clark04.com>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: EJB's vs. Hibernate vs. Torque vs. custom DTO's
Posted by Joe Germuska <Jo...@Germuska.com>.
This week I've embarked on using OJB as a persistence framework in my
second major project, and I'm very enthusiastic about it. When I
first started learning OJB, Hibernate hadn't yet shot to the
prominence it has now, and sometimes I wonder whether I should switch
midstream... but I haven't found any real reasons not to use OJB,
and I know it at least a little better than Hibernate. My
co-developer reviewed the debates between the two out there and
concluded that it's basically a religious issue.
Torque requires autogeneration of persistence code, which seems like
an outdated strategy. I think there are some neat things in the
Torque libraries, but I doubt that a new project would choose it over
either Hibernate, OJB, or some JDO implementation which does all of
that at run-time.
I'm still generally an EJB skeptic. I have a feeling that unless one
really wants to be ready for a clustered deployment, they are
overkill for most purposes.
No matter which one of these you use, you're best off defining some
kind of persistence interface so that you can switch to the next
"flavor-of-the-month" when your needs change. With this, the biggest
obstacle is how to discover your implementation interface, but I've
been pretty happy with Commons Discovery for that; I've written a
"DiscoverySupport" class for internal use here that encapsulates the
most common use pattern into something that is really trivial to use.
I'm interested in the rapidly developing "microkernel" field
(HiveMind, Keel, PicoContainer, Spring...) but haven't made the time
to choose one of them.
To bring this back to being slightly on-topic, I wonder if Struts
should formally adopt one of these microkernel tools (or build/adapt
one) in the future? Or is that best left up to each application
developer?
Joe
--
Joe Germuska
Joe@Germuska.com
http://blog.germuska.com
"We want beef in dessert if we can get it there."
-- Betty Hogan, Director of New Product Development, National
Cattlemen's Beef Association
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: EJB's vs. Hibernate vs. Torque vs. custom DTO's
Posted by Erik Tjernlund <er...@tjernlund.net>.
Sasha Borodin wrote:
> Thus, I'd like to get some opinions as to the level of complexity and
> appropriate use of EJBs and other object-relational bridging technologies.
Norman Kleins talk "Data Persistence Frameworks: An Introduction to
Hibernate" begins with a short, but excellent summary of existing
persistence frameworks and their pros and cons (and is of course
pro-hibernate, but with that in mind...):
<http://www.baychi.org/calendar/files/hibernate-talk/hibernate-talk.pdf>
<http://www.baychi.org/bof/struts/20030903/>
The new interview with Hibernates Gavin King on TheServerSide is also
extremely informative. Great to hear such articulate and pragmatic
thoughts on this conflict filled subject:
<http://www.theserverside.com/events/index.jsp>
/Erik
--
<http://erik.tjernlund.net/webblogg/>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: EJB's vs. Hibernate vs. Torque vs. custom DTO's
Posted by Joe Germuska <Jo...@Germuska.com>.
Be careful -- I don't think you want to lump Hibernate with iBatis;
they sound pretty different.
As for your questions:
> - lazy loading / selective saving?
OJB definitely supports lazy loading, and it has some support for
dynamic proxying -- from the docs, it appears that you don't have to
write your own proxy classes for collections, and it has support for
Java 1.3 and later dynamic proxying, and you can just write your own
proxy class. I haven't gotten too deep with this...
> - what if an object is spread over several tables in a legacy
> database?
I don't have a legacy database; I'm making mine up right now -- but
one of the things I'm most impressed with is the way that 1:n and m:n
relationships seem to just work. For example, I need a query that
returns orders which have line items that match certain criteria --
the query is totally intuitive (which is good, because documentation
is one place where OJB is sometimes lacking, although this has been
improving a lot lately...)
One very cool feature which is relatively new is support for
"anonymous" references -- you don't always have to go adding
identifier properties to your objects in cases where they can be
implicitly identified. (This is hard to summarize in a nutshell, but
there's a whole "How To" on the OJB site about it...)
I suspect that Hibernate does most of these things too, or people
wouldn't be so enthusiastic about it. Hibernate recently "joined"
JBoss, which means it's likely to keep developing. But if you are
concerned about licenses, the Apache license (OJB) is less
restrictive than the LGPL (Hibernate).
Joe
At 15:19 -0500 10/3/03, Sasha Borodin wrote:
>Hibernate/iBATIS
> the bad:
> - not a standard spec (IF that's "bad" anyway)
> the good (awesome):
> - I love the "non-intrusive" nature of adding the persistence
> functionality; you don't have to modify your beans
> questions:
> - lazy loading / selective saving?
> - what if an object is spread over several tables in a legacy
> database?
>
>If anyone's got anything to add, please do. I think this is a topic that
>itches the brains of many newbies watching the struts-user list. Thanks
>again.
--
Joe Germuska
Joe@Germuska.com
http://blog.germuska.com
"We want beef in dessert if we can get it there."
-- Betty Hogan, Director of New Product Development, National
Cattlemen's Beef Association
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: EJB's vs. Hibernate vs. Torque vs. custom DTO's (EJBs are OK)
Posted by Ted Husted <hu...@apache.org>.
Mike Duffy wrote:
> As someone who started out processing HTML forms with CGI and PERL, I
> am very thankful for the contributions made by the Struts team. I
> often wonder why the JCP didn't take in Struts as a standard and build
> on that standard. Instead, it looks like they kidnapped one of the
> main developers of Struts and started from scratch with Java Server
> Faces. :)
The JSF has been a long time coming. Everything started at about the
same time back then: Struts, Jakarta Taglibs, and the JSF initiative.
The reason we have all three now is that we all began at once, and, at
the time, there was no telling what would survive and what would die on
the vine.
> The key point in determining the dominance of a technology is the quality of the tools developed
> to implement that technology (the "Beast of Redmond" clearly understands this concept). People
> who have resources to invest in the development of tools are going to make that investment based
> on establish standards. That is why I think JSF will eventually supersede Struts.
Some standards are established by bodies like the JCP. Others are
established by the marketplace. Struts support is cropping up in tools
everywhere now, because it's what the marketplace wants. If the
marketplace starts using JSF, then tool vendors will increase their
investment in JSF. But, so long as their is a market for Struts tools,
vendors will rush in to fill the void.
> Right now, the EJB standard is certainly not perfect, but it is OK.
> My guess/hope is that the EJB standard will continue to improve.
> As stated earlier, XDoclet makes EJB incredibly cool to use.
Which is the sort of dynamic that will likely arise between Struts and
JSF. If history is any guide, there will be places where JSF comes up
lacking, and open source projects like Struts will rush into fill the
void. Open source abhors a vacuum :)
-Ted.
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: EJB's vs. Hibernate vs. Torque vs. custom DTO's (EJBs are OK)
Posted by "Craig R. McClanahan" <cr...@apache.org>.
Mike Duffy wrote:
>Correctly stated, some of the Struts taglibs have been superseded by JSTL.
>
>We are starting a major new project and we are trying to guess which technologies have the best
>viability. We have made a decision to use Struts because it is the best current solution and we
>think the controller aspects of Struts will be around for several years. We will use JSTL because
>it is a functional standard that is easy to use and it integrates with the Struts html-el tags.
>We have a "wait and see" attitude toward JSF.
>
>
A perfecty rational attitude at the moment, although I would still
recommend becoming familiar with the new technology. I think you'll
find the adoption uptake (once JavaServer Faces goes final) to be pretty
fast.
>As someone who started out processing HTML forms with CGI and PERL, I am very thankful for the
>contributions made by the Struts team. I often wonder why the JCP didn't take in Struts as a
>standard and build on that standard. Instead, it looks like they kidnapped one of the main
>developers of Struts and started from scratch with Java Server Faces. :)
>
>
Not exactly "kidnapped" -- I'm getting *paid* to develop JavaServer
Faces :-).
More seriously, though, the sweet spot that JavaServer Faces aims at is
somewhat different than where Struts is aimed at. JavaServer Faces is
aimed primarly at providing rich components, and just enough
foundational stuff to build an application framework on top of. Struts
doesn't have a UI component model at all (the HTML tags do not count --
they are simply ways to render simple input fields -- which is why we
have to work so hard at things like tree controls and grids), but shines
in its overall framework characteristics. The right answer will be to
use both technologies when you need both feature sets.
I wouldn't be surprised to see standardization in the web application
framework space at some point ... but it needs to be based on a standard
UI component model first. In the mean time, JavaServer Faces is also
focused on providing sufficient APIs and metadata to make high quality
tooling easier; that is one of the other things that Microsoft learned.
>The key point in determining the dominance of a technology is the quality of the tools developed
>to implement that technology (the "Beast of Redmond" clearly understands this concept). People
>who have resources to invest in the development of tools are going to make that investment based
>on establish standards. That is why I think JSF will eventually supersede Struts.
>
>
Actually, tools support for Struts is pretty broad at the moment, and
inertia is a *very* powerful force ... JavaServer Faces will have some
catching up to do, but it's clear that this is going to happen quickly.
>Mike
>
>
Craig
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: EJB's vs. Hibernate vs. Torque vs. custom DTO's (EJBs are OK)
Posted by Mike Duffy <md...@yahoo.com>.
Correctly stated, some of the Struts taglibs have been superseded by JSTL.
We are starting a major new project and we are trying to guess which technologies have the best
viability. We have made a decision to use Struts because it is the best current solution and we
think the controller aspects of Struts will be around for several years. We will use JSTL because
it is a functional standard that is easy to use and it integrates with the Struts html-el tags.
We have a "wait and see" attitude toward JSF.
As someone who started out processing HTML forms with CGI and PERL, I am very thankful for the
contributions made by the Struts team. I often wonder why the JCP didn't take in Struts as a
standard and build on that standard. Instead, it looks like they kidnapped one of the main
developers of Struts and started from scratch with Java Server Faces. :)
The key point in determining the dominance of a technology is the quality of the tools developed
to implement that technology (the "Beast of Redmond" clearly understands this concept). People
who have resources to invest in the development of tools are going to make that investment based
on establish standards. That is why I think JSF will eventually supersede Struts.
Regarding a persistence model, Mark Galbreath is right, JDO is a simple answer and JDO is a
standard. JDO may turn out to be the answer, if the EJB specification team does not build upon
the improvements made in EJB 2.0. Right now, the EJB standard is certainly not perfect, but it is
OK. My guess/hope is that the EJB standard will continue to improve. As stated earlier, XDoclet
makes EJB incredibly cool to use.
There is a very good book that goes into great detail on these issues: Bitter EJB, by Tate,
Clark, Lee, Linsky.
http://www.amazon.com/exec/obidos/ASIN/1930110952/qid%3D1065295596/sr%3D11-1/ref%3Dsr%5F11%5F1/102-7314677-9317754
According to the authors, JBoss 4.0 will offer service decoupling, "...hopefully, other
application service vendors [and the EJB specification team] will follow its lead."
One of the interesting things I learned by reading this book is that Entity Beans were an
afterthought to the original EJB spec. In early drafts, the EJB spec was focused exclusively on
distributed components, not persistence. It is not surprising that the original persistence
mechanism was poor. My guess/hope is that within a year there will be a completely decoupled fine
grained persistence service within EJB. Perhaps there will be some sort of "byte code
enhancement" for entity beans. :(
Mike
--- Ted Husted <hu...@apache.org> wrote:
> Mike Duffy wrote:
> > In the short term, a non-standard solution may be the only choice available. If so, the best
> > thing to do is to design your code in a way that isolates the non-standard components. If you
> > really think Hibernate or iBATIS is the way to go, then go through delegates to your data
> access
> > layer. This will make future changes less painful.
>
> Very good advice. Both the Hibernate and iBATIS teams consider using a
> DAO layer to be a best practice (and I suspect OJB does too). iBATIS
> ships a DAO framework as a separate component which works with most
> anything you can name, including Hibernate and EJBs.
>
>
> > Because Struts will eventually be superseded by Java Serer Faces, I strongly recommend that
> you
> > keep your Action classes as light as possible.
>
> Most people have always recommended keeping your Action classes as light
> as possible. Still good advice. But, I don't think that most people
> believe that it is a foregone conclusion that Struts will be superseded
> by JSF. There are people who say such things, but saying it doesn't make
> it so.
>
> JSF does include a navigational element that will be enough for many
> applications. But it does not include anything like the Struts
> Controller. Or Tiles. Or the Validator, Struts-Menu, Struts-Workflow,
> Struts-BSF, and so forth.
>
> I'd say something like "JSF has a lot of catching up to do", but it's
> not an either/or decision. People can, and I'm sure will, use Struts and
> JSF together. The technologies are complementary. Struts is strongest
> where JSF is weakest, and vice versa.
>
> JDBC didn't eliminate the need for packages like Hibernate and iBATIS.
> JSP didn't eliminate the need for XLS or Velocity templates. JSTL didn't
> eliminate the need for custom taglibs. And JSF won't be the final
> solution either. These types of specifications are only the beginning.
>
>
> > Note: Many of the Struts functions have already been superseded by the functions of the JSTL.
>
> > There is no longer a need for Struts bean tags or logic tags. There is a need for the Struts
> > html-el tags. They allow interaction with JSTL and enable the MVC funtionality. If you limit
> > your use of Struts tags now, you'll be able to make an easier transition to Java Server Faces
> and
> > JSTL.
>
> Many of the functions of the Struts JSP taglibs are being superseded
> (thankfully!), but Struts is primarily a Controller. The bundled taglibs
> are one way to access the Controller, but there are many others, such as
> the Velocity Tools and Stxx.
>
> The taglibs generate a lot of traffic on the list (and hopefully JSF
> will draw some that fire someday). But they are not what define Struts.
> Struts is the C in MVC. The taglibs are just a proof of concept. (And a
> great one at that, given they help spawn things like JSTL and JSF.)
>
> With JSF and Commons Chain helping to define what it means to be a View
> and a Model, we will finally have the freedom to focus on our core
> business: what it means to be a Controller.
>
> -Ted.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: EJB's vs. Hibernate vs. Torque vs. custom DTO's (EJBs are OK)
Posted by Ted Husted <hu...@apache.org>.
Mike Duffy wrote:
> In the short term, a non-standard solution may be the only choice available. If so, the best
> thing to do is to design your code in a way that isolates the non-standard components. If you
> really think Hibernate or iBATIS is the way to go, then go through delegates to your data access
> layer. This will make future changes less painful.
Very good advice. Both the Hibernate and iBATIS teams consider using a
DAO layer to be a best practice (and I suspect OJB does too). iBATIS
ships a DAO framework as a separate component which works with most
anything you can name, including Hibernate and EJBs.
> Because Struts will eventually be superseded by Java Serer Faces, I strongly recommend that you
> keep your Action classes as light as possible.
Most people have always recommended keeping your Action classes as light
as possible. Still good advice. But, I don't think that most people
believe that it is a foregone conclusion that Struts will be superseded
by JSF. There are people who say such things, but saying it doesn't make
it so.
JSF does include a navigational element that will be enough for many
applications. But it does not include anything like the Struts
Controller. Or Tiles. Or the Validator, Struts-Menu, Struts-Workflow,
Struts-BSF, and so forth.
I'd say something like "JSF has a lot of catching up to do", but it's
not an either/or decision. People can, and I'm sure will, use Struts and
JSF together. The technologies are complementary. Struts is strongest
where JSF is weakest, and vice versa.
JDBC didn't eliminate the need for packages like Hibernate and iBATIS.
JSP didn't eliminate the need for XLS or Velocity templates. JSTL didn't
eliminate the need for custom taglibs. And JSF won't be the final
solution either. These types of specifications are only the beginning.
> Note: Many of the Struts functions have already been superseded by the functions of the JSTL.
> There is no longer a need for Struts bean tags or logic tags. There is a need for the Struts
> html-el tags. They allow interaction with JSTL and enable the MVC funtionality. If you limit
> your use of Struts tags now, you'll be able to make an easier transition to Java Server Faces and
> JSTL.
Many of the functions of the Struts JSP taglibs are being superseded
(thankfully!), but Struts is primarily a Controller. The bundled taglibs
are one way to access the Controller, but there are many others, such as
the Velocity Tools and Stxx.
The taglibs generate a lot of traffic on the list (and hopefully JSF
will draw some that fire someday). But they are not what define Struts.
Struts is the C in MVC. The taglibs are just a proof of concept. (And a
great one at that, given they help spawn things like JSTL and JSF.)
With JSF and Commons Chain helping to define what it means to be a View
and a Model, we will finally have the freedom to focus on our core
business: what it means to be a Controller.
-Ted.
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: EJB's vs. Hibernate vs. Torque vs. custom DTO's (EJBs are OK)
Posted by Mike Duffy <md...@yahoo.com>.
I think that Hibernate and iBATIS were probably created in reaction to the inefficiencies and
complexities of EJB 1.1. In terms of efficiency, EJB 2.0 is a significant improvement over EJB
1.1. In terms of complexity, XDoclet offers an elegant approach to coding EJBs
(http://xdoclet.sourceforge.net/).
If you choose a non-standard solution, created by a group of individuals (no matter how capable or
well meaning those individuals are), you run the risk that the non-standard solution will
eventually be eclipsed by a standard solution (see the thread earlier this week on Struts vs.
JSF). The Java Community Process is not necessarily expeditious, but it is deliberate, and it
brings in some of the best and brightest people in the industry (these people are aware of
existing problems).
In the short term, a non-standard solution may be the only choice available. If so, the best
thing to do is to design your code in a way that isolates the non-standard components. If you
really think Hibernate or iBATIS is the way to go, then go through delegates to your data access
layer. This will make future changes less painful.
I think there are standard approaches currently available that offer good solutions based on the
complexity of your application:
If your application is very simple (e.g., you need to display fields from a database on a web page
for an internal application), use the database actions in JSTL. These actions are efficient and
relatively easy. A general rule of thumb might be that any web application that does not require
form input can be done purely in JSTL. Note: This approach is religious heresy to those who
believe MVC is a religion. :)
If your application is moderately complex (e.g., form based input, a few business logic rules, a
limited number of database tables, and the expectation of only a few hundred concurrent users)
then using Struts to handle the MVC and writing your own data access objects is a very workable
solution. The java.sql package is proven and reliable. When you create DAO classes that CRUD
business model classes, a clear method pattern emerges. Also, you have direct control, so you can
easily create specialty methods.
Because Struts will eventually be superseded by Java Serer Faces, I strongly recommend that you
keep your Action classes as light as possible. Do not perform transformations, business logic, or
data access from within your Action class. Get your form bean, send it off to a factory class
that debreifs the form bean into a business model object or objects. Send your business model
object(s)off to worker classes to perform business logic processing. Send your business model
object(s)off to delegates that call your data access objects.
Note: Many of the Struts functions have already been superseded by the functions of the JSTL.
There is no longer a need for Struts bean tags or logic tags. There is a need for the Struts
html-el tags. They allow interaction with JSTL and enable the MVC funtionality. If you limit
your use of Struts tags now, you'll be able to make an easier transition to Java Server Faces and
JSTL.
If you are creating a complex enterprise application, then the services provided by an EJB server
are greatly beneficial (see Mastering Enterprise JavaBeans 2/E, Roman, et.al.). These services go
far beyond persistence. Mostly prior to EJB 2.0, one aspect of these services, Entity Beans, have
been slammed as a poorly designed persistence mechanism. You could drop Entity Beans and mix a
non-standard persistence mechanism into EJBs (Hibernate offers guidelines for doing this; the
creators of JDO also made this case); I think this would be a bad idea.
I think there are times when a non-Standard implementation is the only good approach. That has
certainly been the case for Struts over the past few years; however, (IMHO) that is not the case
for persistence mechanisms today. The short term benefit of mixing in a non-standard persistence
mechanism does not out way the long term benefit of staying with a standard (and not having to
refactor at some future time). There are certainly hundreds (perhaps thousands) of developers
working to improve the implementation of EJBs. This collective effort based on a community
standard will overwhelm the efforts of well meaning individuals working on non-standard
appraoches.
Good luck.
Mike
--- Sasha Borodin <sa...@whoissasha.com> wrote:
> Thank you very much for everyone's responses.
>
> Reading your links and posts, I'm forming the following thoughts:
>
> EJB's
> the bad:
> - more overhead to design and deploy
> - require an app server
> - no inheritance
> the good:
> - standard
> - spec encompasses most (if not all) enterprise features I could
> ever want, and probably never use
>
> Hibernate/iBATIS
> the bad:
> - not a standard spec (IF that's "bad" anyway)
> the good (awesome):
> - I love the "non-intrusive" nature of adding the persistence
> functionality; you don't have to modify your beans
> questions:
> - lazy loading / selective saving?
> - what if an object is spread over several tables in a legacy
> database?
>
> If anyone's got anything to add, please do. I think this is a topic that
> itches the brains of many newbies watching the struts-user list. Thanks
> again.
>
> -Sasha Borodin
>
> On 10/3/03 14:45, "Sgarlata Matt" <sg...@bah.com> wrote:
>
> > I've done a good bit of research on this, and here's the general impression
> > I get from various different sources:
> >
> > * EJBs are good when you need very advanced enterprise features like
> > advanced transaction support and a distributed architecture. However, you
> > need to be careful that your EJBs are designed correctly or they can have
> > serious performance problems.
> > * Hibernate is the most popular object-to-relational tool on the market
> > right now. (I plan to use it in my next project.) The one downside is that
> > it uses the LGPL license, which can be a problem on some projects.
> > * Lots of people like OJB, but I heard once it was tricky to set up. If you
> > can't use Hibernate because of the license, this would probably be your
> > second-best choice. (see Joe's email for additional comments).
> > * Torque is a Jakarta DB project that I am currently using. It makes me
> > nervous because it depends on a few nightly builds and other components in
> > the sandbox.
> > * In the future it looks like JDO will be a good choice. It is a
> > persistence mechanism for Java objects. Strictly speaking, it is not an
> > object-to-relational mapping tool *yet* but I heard it will be when JDO 2.0
> > comes out.
> >
> > Matt
> > ----- Original Message -----
> > From: "Sasha Borodin" <sa...@whoissasha.com>
> > To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> > Sent: Friday, October 03, 2003 3:09 PM
> > Subject: EJB's vs. Hibernate vs. Torque vs. custom DTO's
> >
> >
> >> I hope I'm not comparing apples and oranges; if I am, please excuse the
> >> ignorance, and slap me upside the head...
> >>
> >> The subject line says it all - I'm investigating the appropriate uses of
> > the
> >> above technologies to move data between databases and objects. Thus far
> > in
> >> my development career, I've relied on my own DTO's - homegrown primitive
> >> lazy loading, caching, etc.
> >>
> >> As I'm starting projects for other companies, I'm realizing that no one
> >> wants home-grown solutions where standards and proven products have
> > already
> >> filled the niche.
> >>
> >> Thus, I'd like to get some opinions as to the level of complexity and
> >> appropriate use of EJBs and other object-relational bridging technologies.
> >>
> >> Who uses what, why, and where? :-)
> >>
> >> -Sasha Borodin
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> >> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: EJB's vs. Hibernate vs. Torque vs. custom DTO's
Posted by Sasha Borodin <sa...@whoissasha.com>.
Thank you very much for everyone's responses.
Reading your links and posts, I'm forming the following thoughts:
EJB's
the bad:
- more overhead to design and deploy
- require an app server
- no inheritance
the good:
- standard
- spec encompasses most (if not all) enterprise features I could
ever want, and probably never use
Hibernate/iBATIS
the bad:
- not a standard spec (IF that's "bad" anyway)
the good (awesome):
- I love the "non-intrusive" nature of adding the persistence
functionality; you don't have to modify your beans
questions:
- lazy loading / selective saving?
- what if an object is spread over several tables in a legacy
database?
If anyone's got anything to add, please do. I think this is a topic that
itches the brains of many newbies watching the struts-user list. Thanks
again.
-Sasha Borodin
On 10/3/03 14:45, "Sgarlata Matt" <sg...@bah.com> wrote:
> I've done a good bit of research on this, and here's the general impression
> I get from various different sources:
>
> * EJBs are good when you need very advanced enterprise features like
> advanced transaction support and a distributed architecture. However, you
> need to be careful that your EJBs are designed correctly or they can have
> serious performance problems.
> * Hibernate is the most popular object-to-relational tool on the market
> right now. (I plan to use it in my next project.) The one downside is that
> it uses the LGPL license, which can be a problem on some projects.
> * Lots of people like OJB, but I heard once it was tricky to set up. If you
> can't use Hibernate because of the license, this would probably be your
> second-best choice. (see Joe's email for additional comments).
> * Torque is a Jakarta DB project that I am currently using. It makes me
> nervous because it depends on a few nightly builds and other components in
> the sandbox.
> * In the future it looks like JDO will be a good choice. It is a
> persistence mechanism for Java objects. Strictly speaking, it is not an
> object-to-relational mapping tool *yet* but I heard it will be when JDO 2.0
> comes out.
>
> Matt
> ----- Original Message -----
> From: "Sasha Borodin" <sa...@whoissasha.com>
> To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> Sent: Friday, October 03, 2003 3:09 PM
> Subject: EJB's vs. Hibernate vs. Torque vs. custom DTO's
>
>
>> I hope I'm not comparing apples and oranges; if I am, please excuse the
>> ignorance, and slap me upside the head...
>>
>> The subject line says it all - I'm investigating the appropriate uses of
> the
>> above technologies to move data between databases and objects. Thus far
> in
>> my development career, I've relied on my own DTO's - homegrown primitive
>> lazy loading, caching, etc.
>>
>> As I'm starting projects for other companies, I'm realizing that no one
>> wants home-grown solutions where standards and proven products have
> already
>> filled the niche.
>>
>> Thus, I'd like to get some opinions as to the level of complexity and
>> appropriate use of EJBs and other object-relational bridging technologies.
>>
>> Who uses what, why, and where? :-)
>>
>> -Sasha Borodin
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: EJB's vs. Hibernate vs. Torque vs. custom DTO's
Posted by Sgarlata Matt <sg...@bah.com>.
I've done a good bit of research on this, and here's the general impression
I get from various different sources:
* EJBs are good when you need very advanced enterprise features like
advanced transaction support and a distributed architecture. However, you
need to be careful that your EJBs are designed correctly or they can have
serious performance problems.
* Hibernate is the most popular object-to-relational tool on the market
right now. (I plan to use it in my next project.) The one downside is that
it uses the LGPL license, which can be a problem on some projects.
* Lots of people like OJB, but I heard once it was tricky to set up. If you
can't use Hibernate because of the license, this would probably be your
second-best choice. (see Joe's email for additional comments).
* Torque is a Jakarta DB project that I am currently using. It makes me
nervous because it depends on a few nightly builds and other components in
the sandbox.
* In the future it looks like JDO will be a good choice. It is a
persistence mechanism for Java objects. Strictly speaking, it is not an
object-to-relational mapping tool *yet* but I heard it will be when JDO 2.0
comes out.
Matt
----- Original Message -----
From: "Sasha Borodin" <sa...@whoissasha.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Friday, October 03, 2003 3:09 PM
Subject: EJB's vs. Hibernate vs. Torque vs. custom DTO's
> I hope I'm not comparing apples and oranges; if I am, please excuse the
> ignorance, and slap me upside the head...
>
> The subject line says it all - I'm investigating the appropriate uses of
the
> above technologies to move data between databases and objects. Thus far
in
> my development career, I've relied on my own DTO's - homegrown primitive
> lazy loading, caching, etc.
>
> As I'm starting projects for other companies, I'm realizing that no one
> wants home-grown solutions where standards and proven products have
already
> filled the niche.
>
> Thus, I'd like to get some opinions as to the level of complexity and
> appropriate use of EJBs and other object-relational bridging technologies.
>
> Who uses what, why, and where? :-)
>
> -Sasha Borodin
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: EJB's vs. Hibernate vs. Torque vs. custom DTO's
Posted by Barry Volpe <st...@childrencare.com>.
This book comes on Object Relational Bridge comes out in December:
http://www.amazon.com/exec/obidos/tg/detail/-/1590592557/qid=1065209603/sr=1-2/ref=sr_1_2/102-1389031-0729721?v=glance&s=books
----- Original Message -----
From: "Sasha Borodin" <sa...@whoissasha.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Friday, October 03, 2003 12:09 PM
Subject: EJB's vs. Hibernate vs. Torque vs. custom DTO's
> I hope I'm not comparing apples and oranges; if I am, please excuse the
> ignorance, and slap me upside the head...
>
> The subject line says it all - I'm investigating the appropriate uses of
the
> above technologies to move data between databases and objects. Thus far
in
> my development career, I've relied on my own DTO's - homegrown primitive
> lazy loading, caching, etc.
>
> As I'm starting projects for other companies, I'm realizing that no one
> wants home-grown solutions where standards and proven products have
already
> filled the niche.
>
> Thus, I'd like to get some opinions as to the level of complexity and
> appropriate use of EJBs and other object-relational bridging technologies.
>
> Who uses what, why, and where? :-)
>
> -Sasha Borodin
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: EJB's vs. Hibernate vs. Torque vs. custom DTO's
Posted by Barry Volpe <st...@childrencare.com>.
In case your interested object relational bridge is covered in this book.
http://www.amazon.com/exec/obidos/tg/detail/-/1861007817/102-1389031-0729721?vi=advice
----- Original Message -----
From: "Sasha Borodin" <sa...@whoissasha.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Friday, October 03, 2003 12:09 PM
Subject: EJB's vs. Hibernate vs. Torque vs. custom DTO's
> I hope I'm not comparing apples and oranges; if I am, please excuse the
> ignorance, and slap me upside the head...
>
> The subject line says it all - I'm investigating the appropriate uses of
the
> above technologies to move data between databases and objects. Thus far
in
> my development career, I've relied on my own DTO's - homegrown primitive
> lazy loading, caching, etc.
>
> As I'm starting projects for other companies, I'm realizing that no one
> wants home-grown solutions where standards and proven products have
already
> filled the niche.
>
> Thus, I'd like to get some opinions as to the level of complexity and
> appropriate use of EJBs and other object-relational bridging technologies.
>
> Who uses what, why, and where? :-)
>
> -Sasha Borodin
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: EJB's vs. Hibernate vs. Torque vs. custom DTO's
Posted by Barry Volpe <st...@childrencare.com>.
This book comes out in December...
http://www.amazon.com/exec/obidos/search-handle-form/102-1389031-0729721
----- Original Message -----
From: "Sasha Borodin" <sa...@whoissasha.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Friday, October 03, 2003 12:09 PM
Subject: EJB's vs. Hibernate vs. Torque vs. custom DTO's
> I hope I'm not comparing apples and oranges; if I am, please excuse the
> ignorance, and slap me upside the head...
>
> The subject line says it all - I'm investigating the appropriate uses of
the
> above technologies to move data between databases and objects. Thus far
in
> my development career, I've relied on my own DTO's - homegrown primitive
> lazy loading, caching, etc.
>
> As I'm starting projects for other companies, I'm realizing that no one
> wants home-grown solutions where standards and proven products have
already
> filled the niche.
>
> Thus, I'd like to get some opinions as to the level of complexity and
> appropriate use of EJBs and other object-relational bridging technologies.
>
> Who uses what, why, and where? :-)
>
> -Sasha Borodin
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: EJB's vs. Hibernate vs. Torque vs. custom DTO's
Posted by Vic Cekvenich <ce...@basebeans.com>.
+1
(bP uses iBatis, one of the first to do so)
.V
Ted Husted wrote:
> In the end, this is a team decision and which decision is right is going
> to depend on who else is on the team. Each of the technologies has their
> own merits and demerits (which is why we keep creating them).
>
> But, if you are used to writing your own DTOs, and all other things
> remaining equal, you should take a good look at iBATIS Database Layer.
>
> http://www.ibatis.com/
>
> It is not an Object Relational Mapping framework, but does a truly
> excellent job of separating data persistence from the rest of your
> application. Clinton posted a very fine comparison of SQL Mapping and
> ORM here:
>
> http://sourceforge.net/forum/forum.php?thread_id=914883&forum_id=206693
>
> A real plus for a Struts developer is that there is a realistic,
> best-practices, soup-to-nuts example Struts/iBATIS application available:
>
> http://www.ibatis.com/jpetstore/jpetstore.html
>
> Regardless of whatever choice you make, I would strongly recommend
> taking a close look at the DAO framework that ships with iBATIS. It is
> not dependant on the iBATIS SqlMaps and can be used with Hibernate, OJB,
> or whatever else. Or nothing else. I also use the iBATIS DAO framework
> to switch to a mock database for testing. (This is the sort of thing Joe
> meant by "persistence interface".)
>
> -Ted.
>
>
> Sasha Borodin wrote:
>
>> I hope I'm not comparing apples and oranges; if I am, please excuse the
>> ignorance, and slap me upside the head...
>>
>> The subject line says it all - I'm investigating the appropriate uses
>> of the
>> above technologies to move data between databases and objects. Thus
>> far in
>> my development career, I've relied on my own DTO's - homegrown primitive
>> lazy loading, caching, etc.
>>
>> As I'm starting projects for other companies, I'm realizing that no one
>> wants home-grown solutions where standards and proven products have
>> already
>> filled the niche.
>>
>> Thus, I'd like to get some opinions as to the level of complexity and
>> appropriate use of EJBs and other object-relational bridging
>> technologies.
>>
>> Who uses what, why, and where? :-)
>>
>> -Sasha Borodin
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>
>>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: EJB's vs. Hibernate vs. Torque vs. custom DTO's
Posted by Ted Husted <hu...@apache.org>.
In the end, this is a team decision and which decision is right is going
to depend on who else is on the team. Each of the technologies has their
own merits and demerits (which is why we keep creating them).
But, if you are used to writing your own DTOs, and all other things
remaining equal, you should take a good look at iBATIS Database Layer.
http://www.ibatis.com/
It is not an Object Relational Mapping framework, but does a truly
excellent job of separating data persistence from the rest of your
application. Clinton posted a very fine comparison of SQL Mapping and
ORM here:
http://sourceforge.net/forum/forum.php?thread_id=914883&forum_id=206693
A real plus for a Struts developer is that there is a realistic,
best-practices, soup-to-nuts example Struts/iBATIS application available:
http://www.ibatis.com/jpetstore/jpetstore.html
Regardless of whatever choice you make, I would strongly recommend
taking a close look at the DAO framework that ships with iBATIS. It is
not dependant on the iBATIS SqlMaps and can be used with Hibernate, OJB,
or whatever else. Or nothing else. I also use the iBATIS DAO framework
to switch to a mock database for testing. (This is the sort of thing Joe
meant by "persistence interface".)
-Ted.
Sasha Borodin wrote:
> I hope I'm not comparing apples and oranges; if I am, please excuse the
> ignorance, and slap me upside the head...
>
> The subject line says it all - I'm investigating the appropriate uses of the
> above technologies to move data between databases and objects. Thus far in
> my development career, I've relied on my own DTO's - homegrown primitive
> lazy loading, caching, etc.
>
> As I'm starting projects for other companies, I'm realizing that no one
> wants home-grown solutions where standards and proven products have already
> filled the niche.
>
> Thus, I'd like to get some opinions as to the level of complexity and
> appropriate use of EJBs and other object-relational bridging technologies.
>
> Who uses what, why, and where? :-)
>
> -Sasha Borodin
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
--
Ted Husted,
Junit in Action - <http://www.manning.com/massol/>,
Struts in Action - <http://husted.com/struts/book.html>,
JSP Site Design - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.
"Get Ready, We're Moving Out!!" - <http://www.clark04.com>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
RE: EJB's vs. Hibernate vs. Torque vs. custom DTO's
Posted by Mark Galbreath <mg...@dirtroad.net>.
simple answer: http://java.sun.com/products/jdo/
Mark
-----Original Message-----
From: Sasha Borodin [mailto:sasha@whoissasha.com]
Sent: Friday, October 03, 2003 3:10 PM
To: Struts Users Mailing List
Subject: EJB's vs. Hibernate vs. Torque vs. custom DTO's
I hope I'm not comparing apples and oranges; if I am, please excuse the
ignorance, and slap me upside the head...
The subject line says it all - I'm investigating the appropriate uses of the
above technologies to move data between databases and objects. Thus far in
my development career, I've relied on my own DTO's - homegrown primitive
lazy loading, caching, etc.
As I'm starting projects for other companies, I'm realizing that no one
wants home-grown solutions where standards and proven products have already
filled the niche.
Thus, I'd like to get some opinions as to the level of complexity and
appropriate use of EJBs and other object-relational bridging technologies.
Who uses what, why, and where? :-)
-Sasha Borodin
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org