Re: searching for yoda - a developer's tale

dexter_at_uwm.edu
Date: 02/25/05


Date: 24 Feb 2005 20:27:28 -0800

Thanks for the input folks.

At this point, Eclipse is "sold". The time it has already saved in
renaming packages has more than made up for the minimal learning curve.
 I slightly miss the vi (actually gvim which is really slick - go check
it out) commands, but as I say, I'm sold overall.

Thus the conversation really turns to how to fit Hibernate into
Eclipse. Again, my problem statement is that I naturally work with
objects and object graphs and would prefer to spend most of my
development effort in this domain. I would like as much as possible to
have mapping and schema handled by the tool. It *seems* to me that the
"natural" mode for Hibernate is to start with the mapping and use the
tools to generate Java and schema. This is still better than starting
with a relational model.

The learning required for these technologies is what I'm confused
about. What exactly do I need to learn? I have a couple of Hibernate
books (the "in Action" is one of them and is, so far, quite good). The
API seems reasonable and not too intimidating. If I were still a
vi/JDBC coder, I would simply add Hibernate API as a tool and
incrementally move forward. But, now that I'm a full-fledged Eclipse
user and committed to focusing on the object model, I'd like to (1)
integrate Hibernate into Eclipse (via any of the afore-mentioned
plug-ins or others), and (2) try to work from the object side of ORM.

Online docs for the plug-ins to solve (1) seem weak. It's hard to tell
which plug-in does what, and what the advantages/disadvantages of each
might be. (2) seems to imply, from my reading, a need for XDoclet or
some other Attribute-Oriented solution to bury the necessary hibernate
tags into the code. Once again, the docs I've found seem weak. More
to the point, as I've mentioned, each new link leads to five others and
their associated technology requirements...It just gets out of hand
quickly. My hope is for someone here to point the way through the fog
and say "here's how to integrate Hibernate" or perhaps "don't bother
integrating Hibernate, use this basic config file and modify as
needed", etc.

Side notes:
Rhino - No, not batch processing. The issue is this: Suppose you have
a complex object graph -- One Root has a List (ordered collection) of
Child(ren). The Root is pulled from the database and passed to a
client application "across the wire". The user interacts with the
object graph by adding/deleting/modifying elements in the List
...perhaps even creating new Root nodes. The user finishes
modifications 'till the object graph is as he wishes it to be, then
sends it back "across the wire" where the server is to persist it.
What's the algorithm? Query the db for each Root node to see if it
already exists. If not, perform an INSERT - otherwise an UPDATE,
DELETE it from the db if it previoulsy existed and the user removed it.
 What does it mean to query the db to see if it already exists? -- It
must be that the object maintains knowledge of its primary key in the
db (which is a wart on the object model). Then for each element of the
List, we must determine if the db already contained it (do an UPDATE if
the state has been changed by the user, otherwise do nothing), or it's
been added by the user (do an INSERT). Elements in the List that the
user deleted must be deleted from the db (but what if a Child might be
"owned" by multiple Roots? -- then it's only deleted if it's not
referenced by any other Roots -- more SELECT statements). Since the
collection is an ordered list (and SQL has no direct concept of such),
how do we now update the additional column "SEQUENCE_NUMBER" to keep
the List ordered properly?

This is a pretty simple object graph and it's already pretty hard at
the db side. How does one handle inheritence? How does one address
differing levels of granularity (not "one table = one object")? I have
an idea how to solve each of these issues, but my point is that if with
my limited db experience and bit of reading, it's likely that I've not
even considered some other gotchas. The highly paid db-gurus have
their own user groups where they debate the finer points of relational
theory ad infinitum. I *really* don't want to have to be that good to
add persistence to my applications. ORM (object/relational mapping) is
a theory unto its own and Hibernate is but one (highly touted)
implementation of it.

Haroon - I'm interested in what you call "other interesting
technologies out there". I know there's a ton, but what do you find
fundamental to your work?

-don.



Relevant Pages

  • Re: [opensuse] Consistency with power privileges
    ... normal user cannot hibernate the system... ... Only root should be able to suspend the system. ... Any true operating system will restrict system services (particularly those ... systems in every sense of the word (very much unlike windoze). ...
    (SuSE)
  • Re: [opensuse] Consistency with power privileges
    ... normal user cannot hibernate the system... ... Only root should be able to suspend the system. ... Unix and unix-like operating systems (including Linux) are true operating ... systems in every sense of the word (very much unlike windoze). ...
    (SuSE)
  • searching for yoda - a developers tale
    ... I've been a Java developer for a great long while, ... I'm made aware of eclipse ... come to like Hibernate. ... one can make Java generate the mapping file if one uses XDoclet ...
    (comp.lang.java.programmer)
  • Hibernate and Eclipse -- where to start?
    ... It *seems* to me that the "natural" mode for Hibernate is to ... now that I'm a full-fledged Eclipse ... Online docs for the plug-ins to solve seem weak. ...
    (comp.lang.java.databases)
  • Using Hibernate Plugin in Eclipse
    ... I downloaded Hibernate plugin and uncompressed it into eclipse/plugins ... Then I started eclipse using -clean command. ... But no Hibernate Wizards are ...
    (comp.lang.java.programmer)