Page 1 of 1

getObjectStringForObject

Posted: Fri Aug 07, 2009 1:07 pm
by ConvertFromOldNGs
by John Munro >> Tue, 17 Apr 2007 19:03:54 GMT

I've just noticed the method Object::getObjectStringForObject and its corresponding String::asObject

I don't understand when (and why) you would use these instead of Object::getOidStringForObject and String::asOid

Anyone have any ideas?

Thanks,

John

Re: getObjectStringForObject

Posted: Fri Aug 07, 2009 1:07 pm
by ConvertFromOldNGs
by BeeJay >> Tue, 17 Apr 2007 22:05:57 GMT

One example of when to use asObject rather than asOid is when you're working in a system with a very large number of classes. If the number of classes in the system is such that the system utilises class numbers in the extended range of user class numbers, then the asOid method will not work correctly for instances of those classes.

ie: To ensure my code will always work as intended, regardless of usage of extended class numbers in a given system, I now ALWAYS use asObject rather than the older asOid method.

Cheers,
BeeJay.