Richard Wallace wrote:
I guess I'm just not seeing the reason to use this with Hibernate. I
mean the whole point of Hibernate is to be able to persist you're POJO
and use them wherever you see fit and not have to worry about all the
complications that arise from EJBs. That's the ideal at least. The
reality is that you do have to worry about the Hibernate session and
loading objects and performing opertations within a session, but I'm
having a hard time buying into the idea of using transfer objects with
Hibernate.
One of the reasons why I am not that much a friend of Hibernate anymore.
I did 4 projects with it, and the problems always were the same...
Overkill in mapping details, Session handling and choking on pojos in
which made things more complicated than they should be, failurs in
dependency resolution on write over more complicated data structures,
which then had to be resolved manually...
Constant banging the heads on small stuff, like having a clean and
proper way to resolve m:n issues. Sometimes there are errors
where Hibernate simply does nothing but does not even throw errors.
Dont get me wrong, Hibernate is an excellent tool, and basically has
solved most of not all issues you constantly run into with Object
Relational mappins and OODBs, but it is options overkill and definitely
not easy to handle.
I am not sure which is more complicated the EJB approach or the options
overkill in Hibernate, which does not force you into anything, but often
simply fails with leaving you standing in the rain.
My opinion is, there must be some kind of middle way, to give you enough
flexibility but does not push you into such a huge complex layer,
Hibernate has evolved into, also 90% of the main problem you constantly
have with hibernate is the complicated way the session handles the
pojos... Dump the wrong pojo into the session and you get a object has
been used failure.... Run out of the session hibernate chokes on lazy
access instead of trying to resolve the problem by opening another one
and trying to load the rest automatically...
I would say, Hibernate is the worst/best working solution you can get
from OSS in regards to ORM mapping, but one thing is for sure, it made
things definitely not easier, although if you have a grip on it, you can
save a lot of time, but aquiring the grip is a hard task, even with the
excellent docs.