Page 1 of 1
What is the difference between Type::getProperty and Type::f
Posted: Fri Aug 07, 2009 1:12 pm
by ConvertFromOldNGs
by John Munro >> Mon, 15 Oct 2007 19:14:40 GMT
Does anybody know what the difference is between Type::getProperty and Type::findProperty?
The documentation doesn't seem to make any distinction between them. I did a quick test and they seem to return the same thing.
Thanks,
John
Re: What is the difference between Type::getProperty and Type::f
Posted: Fri Aug 07, 2009 1:13 pm
by ConvertFromOldNGs
by Allistar >> Mon, 15 Oct 2007 20:53:30 GMT
I'm just guessing, but you may find one looks only at the direct type instance, while the other looks at the superschemaType of the Type instance as well. There are other metadata methods that make this distinction too. --
A.
Re: What is the difference between Type::getProperty and Type::f
Posted: Fri Aug 07, 2009 1:13 pm
by ConvertFromOldNGs
by John Munro >> Mon, 15 Oct 2007 21:12:17 GMT
Aha, ok in that case what's the difference between Class::findProperty and Class::getPropertyInHTree, since they both say they can return properties on superclasses?
John
Re: What is the difference between Type::getProperty and Type::f
Posted: Fri Aug 07, 2009 1:13 pm
by ConvertFromOldNGs
by Jade Support >> Mon, 15 Oct 2007 21:24:19 GMT
Allistar is correct.
Type.getProperty and Type.findProperty are both abstract. The JADE 6.2 documentation has been changed to be similar to that in the Class class. In the implementations for the Class class, it already states that findProperty looks in superschemas. The documentation has been clarified to note Class::getProperty does not look in superschemas.
When using Class::getPropertyInHTree, if the method does not exist in the receiver class, superclasses are searched.
Regards,
Jade Support.
Re: What is the difference between Type::getProperty and Type::f
Posted: Fri Aug 07, 2009 1:13 pm
by ConvertFromOldNGs
by John Munro >> Tue, 16 Oct 2007 14:16:15 GMT
OK, so getProperty doesn't look on superclasses or superschemas, findProperty doesn't look on superclasses but it does look in superschemas and getPropertyInHTree looks on both superclasses and superschemas?
John
Re: What is the difference between Type::getProperty and Type::f
Posted: Fri Aug 07, 2009 1:13 pm
by ConvertFromOldNGs
by Jade Support >> Wed, 17 Oct 2007 20:58:12 GMT
John, not quite.
Class::findProperty()
- Does look in both superclasses and superschemas.
Class::getProperty()
- Doesn't look on superclasses or superschemas.
Class::getPropertyInHTree()
- Does look in both superclasses and superschemas.
I have confirmed with the Plant, there is no difference in functionality between findProperty() and getPropertyInHTree().
Regards,
Jade Support.
Re: What is the difference between Type::getProperty and Type::f
Posted: Fri Aug 07, 2009 1:13 pm
by ConvertFromOldNGs
by Allistar >> Mon, 15 Oct 2007 21:26:23 GMT
Not too sure - there do appear do be a lot of similar methods for accessing metadata. For example: Class::allSubclasses, ::getSubclasses, .subclasses.
I know that getPropertyInHTree and getMethodInHTree don't look at subschema copy classes (I've just implemented a Jade parser and have faced and overcome these issues).
Another interesting (and annoying) thing I've noticed is that RootSchema primitive collection classes like StringArray and DateArray don't have the CollClass::membershipType property set to anything. I would expect this to be set to String and Date respectively.
--
A.