Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / November 2006

Tip: Looking for answers? Try searching our database.

a problem about understanding jboss

Thread view: 
david wolf - 09 Nov 2006 17:54 GMT
I was reading the jboss docs and came across the following statement:

'Most developers know that the type of a class in Java is a function of
the fully qualified name of the class. However the type is also a
function of the java.lang.ClassLoader that is used to define that
class."

What does this mean?

I mean what does the function mean in this statement?

Can someone give me an explanation/

Thanks a lot,

David
Arne Vajhøj - 09 Nov 2006 18:13 GMT
> I was reading the jboss docs and came across the following statement:
>
[quoted text clipped - 8 lines]
>
> Can someone give me an explanation/

It means that if the class mypackage.MyClass is loaded by two
different classloaders, then it is considered two different classes
by the JVM.

Arne
Eric Sosman - 09 Nov 2006 18:29 GMT
david wolf wrote On 11/09/06 12:54,:
> I was reading the jboss docs and came across the following statement:
>
[quoted text clipped - 4 lines]
>
> What does this mean?

   It means that if you have two ClassLoaders, L1 and L2,
and each of them loads a class named com.dot.SomeClass,
there are two different classes named com.dot.SomeClass
floating around in the JVM.  Even if the two classes have
exactly the same bytecode -- even if they were loaded from
the exact same .class file -- they are different classes
because one is in L1's "domain" and the other is in L2's.

> I mean what does the function mean in this statement?

   They're using "function of" in a rather loose pseudo-
mathematical sense: If changing X produces a change in Y,
we may say that Y "is a function of" X.  The area of a
square "is a function of" the length of its sides; your
chance of winning at poker "is a function of" the other
players' skill; the attentiveness of a salesman "is a
function of" how much he thinks he can sell you.

   IMHO the quoted use is not a particularly good one.
The identity of a loaded class *is* the combination of
its fully-qualified name and the ClassLoader that loaded
it, and it would be more straightforward simply to say so
instead of to drag in this "function of" verbiage.  True,
the identity function is a function (the identity function
maps a thing to itself: X is a function of X), so what's
said isn't wrong -- it's just wordier than it needs to be.

Signature

Eric.Sosman@sun.com



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.