-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 9 posts ] 
Author Message
 Post subject: When will HiA 2nd Edition reference book be available?
PostPosted: Fri Jun 23, 2006 3:12 am 
Regular
Regular

Joined: Wed Apr 12, 2006 12:49 am
Posts: 105
Location: Malaysia
Hi,

When will Hibernate in Action 2nd Edition reference book be available?

Thank you.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 23, 2006 4:13 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
http://blog.hibernate.org/cgi-bin/blosx ... /jpwh.html


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 14, 2006 4:51 pm 
Newbie

Joined: Mon Jun 07, 2004 12:59 pm
Posts: 13
I don't mean to be picky but this claim

In Java, all classes are of equal standing--all objects have their own identity and lifecycle and all class instances are passed by reference. Only primitive types are passed by value.

can cause confusion (or worse) among some. Most of us are taught that *everything* in Java is passed by value.

The above claim occurs on page 146 (chapter 4) of the MEAP rough draft.

Regards,
Allan M. Hart


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 14, 2006 6:02 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Quote:
Most of us are taught that *everything* in Java is passed by value.


That is wrong. Copying the value of a variable into another variable is not pass by value, if the value that is being copied is a pointer. See, everything becomes easier if you talk about values, variables, and pointers, and leave out stuff like "objects". That would be something that should be taught, but isn't.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 15, 2006 4:03 pm 
Newbie

Joined: Mon Jun 07, 2004 12:59 pm
Posts: 13
O.k., I don't wish to quibble and I do appreciate your point. OTOH, the discussion on p. 65 of the "The Java Programming Language, Fourth Edition"
by Arnold, Gosling and Holmes disagrees with your position.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 17, 2006 9:51 am 
Beginner
Beginner

Joined: Wed Jan 25, 2006 10:18 am
Posts: 28
Why do people always say Java passes arguments by value? It's obviously not true for Objects, only for primitives.
There has to be some confusion about what "by value" really means. Sure, you're passing the object reference "value" but not the object value as you would if you passed by value in C++.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 17, 2006 12:26 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
And calling pointers "reference" is not helping either, although I do that too from time to time. I really try to avoid "object" like the plague though, as there is simply no definition that two people would agree on. When you use variable, value, pointer, instance, class, and type, you can actually communicate something.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 18, 2006 6:13 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
OK, I've researched different opinions on this and my conclusion is that both views have some validity, especially if you want to simplify an explanation like we want to do in the book. I'm relying on this textbook: http://www.info.ucl.ac.be/~pvr/book.html

The authors write about parameter passing in Java:

Quote:
Parameter passing to methods is done with call by value. A copy of the value is passed to the method and can be modified inside the method without changing the original value. For primitive values, such as integers and floats, this is straightforward. Java also passes object references (not the objects themselves) by value. So objects can almost be considered as using call by reference. The difference is that, inside the method, the field can be modified to refer to another object.


I've personally never bothered to write C++ pointers in my life, so I let this statement in the book how it was. In the interest of making things even simpler, I will now remove it completely. After all, my goal is to let readers focus on data management, not on language design.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 18, 2006 6:45 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
*sigh*

That last note should have been "I've personally never bothered to write C++ references in my life so everything is a pointer to me in Java", otherwise it makes no sense. Case closed, thanks for pushing me to read up on Java lingo.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 9 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.