Laurie Harper wrote:

Tamas Szabo wrote:

it seems to you ok that the org.apache.commons.beanutils.PropertyUtils.describe(Object )
method puts the class property(coming from java.lang.Object) in the map?

I'm not sure about this, but it would be more logical for me if the class was not in the Map(if it was not handled as a normal property). I mean when I write a bean I declare all of the properties I want to consider properties.
But because all the beans extend Object, I also get Object's properties.
It just doesn't seems right to me :-)


Seems perfectly reasonable to me; that's inheritance at work ;-) describe() will pull everything that looks like a bean property as defined by the JavaBeans spec, which includes 'class'. Why do you think this property should be handled specially?

Because it is special! :-)
We get this property only because we must inherit from Object.

Let's say you have to design the java classes again.
You have Object which will be the parent of everything and you also know that you will have JavaBeans, which must inherit from Object and the methods starting with get are special to JavaBeans. Would you name one or more of the Object methods getXxx()?
I think I wouldn't.

However, I think that this whole thing isn't worth a lot of time to discuss it, it probably has no practical consequences.
It was just a theoretical question...

Is having it appear in the map causing a problem somewhere?

Yes. In my generic toString() method [firstName=Jack, class=class sztamas.project.model.vo.User, lastName=Black, ...]. :-)
But I removed class from the Map before constructing the String.
Seriously I cannot think of any big problems that it could cause.

Tamas



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to