On 12/22/2012 05:31 PM, Michael Jaruska wrote:
hmm, i was in hope not to make spam but instead of (short) point to
some notes
about using cayenne without modeler but just hand-editing xml files
there was rubbish
about xml and editing them by hand. i'm editing xml by hand for more
than 10 years
without problems and there's more efective formats for machines than xml.
btw: in cayenne i'm beginner, hibernate, ibatis etc i'm using for
years and
yes, i (and in fact all my colleagues) am editing xml's by hand.
from this point of view, programmers of modeler are programming in
wrong way...
I used to edit SQL by hand for years. I've even hand created mapping
from SQL results into objects. I'm sure we all have. The whole point of
ORMs is to make life easier. I believe the Cayenne community takes a
different approach to all of this than many other systems. I haven't
seen this explicitly state, but this is the general feeling I get.
There's a famous talk about how ORMs suck. One of my sys admins sent it
to me a couple of years ago, but I can't find it now. In it, the
speakers goes off on a rant about how ORMs were supposed to make life
better, easier for the developer. Then he shows some annotation hell
from Hibernate, and asks at what point did we decide that those
annotations were better than straight SQL?
With Cayenne we get to skip the SQL, we get to skip writing code (as it
is generated), and we get to skip the horrible annotations (it doesn't
use them). That leaves us with the XML document to generate the code, to
do our SQL. Honestly, I think I would rather do straight SQL than have
to generate the XML. That's what you have to do in Torque. On of the
things that makes Cayenne stand apart is that modeler. The modeler is
accurate and quick. I can get in, do what I need to do, and get on with
more interesting parts of my code.
In this way the developers of the modeler has done exactly what I want,
something quick, simple, and less error prone than doing SQL,
annotations, or XML directly.
Like others have said, if you want to do it by hand, use the modeler as
a tutorial. You can quickly figure out what it is doing by diffing your
changes as you go. There are times when editing by hand is advantageous,
with the modeler providing validation. Other developers can pick up your
changes in commit messages fairly well.