Following the discussion here http://communities.progress.com/pcom/thread/27093 and other off list exchanges, I have add four new requests to the ERS as follows:
tamhas wrote:
Following the discussion here http://communities.progress.com/pcom/thread/27093 and other off list exchanges, I have add four new requests to the ERS as follows:
0000004045 – Add ID or Handle attribute to Progress.Lang.Object.It is necessary at times in OO programming to determine where two different object references point to the same object. I propose adding an ID or Handle attribute to Progress.Lang.Object such that one can make tests of the form “IF ObjRef1.ID = ObjRef2.ID THEN”.Currently, one can use “int(ObjRef1) = int(ObjRef2)” for this test, but this is more obscure than a simple attribute....0000004047 – Add GUID to Progress.Lang.ObjectWith reference to Enhancement Requests 4045 and 4046, if an object has been serialized and then reconstituted as a new object, either after transmission or being stored, it will have a new object ID. It is desirable to have a mechanism which would allow one to tell whether such a new object was the same as another object. E.g., if an object is serialized and sent to a client where it is de-serialized, processed, re-serialized and returned to the original session where it is deserialized into a new object, one would like to be able to tell which existing object this new object was derived from. The ObjRef.ID proposed in 4045 will not do this since it will be a new object. Therefore, one should add a GUID attribute to Progress.Lang.Object which will be serialized with the rest of the object’s data members in order to identify which original object this object was derived from.This feature provides object identity across serialization-deserialization boundaries.There is no workaround other than adding the GUID property separately to every class.0000004048 – Add Hashcode attribute to Progress.Lang.ObjectIt is desirable in OO programming to be able to determine when two objects are effectively clones of one another, i.e., they are the same type and have the same state. The ID proposed in 4045 provides an easy way to identify whether they are actually the same object and we already have the ability to tell if they are the same type, but there is no quick way to tell if they have the same state other than attribute by attribute comparisons and, even there, any private state can not be compared. Therefore, it is proposed to add a Hashcode property to Progress.Lang.Object which would serialize the data members of the object into XML (see 4046), excluding the ID from 4045 and the GUID proposed in 4047 as well as any properties or variables with XML-NODE-TYPE marked as HIDDEN as per 4046 and then compute a SHA1-DIGEST of this XML and present this as an attribute of Progresss.Lang.ObjectThis attribute would provide extremely rapid comparison of object state equality.There is no workaround other than to manually implement this functionality in every class.
Handles currently use "unique-id" to fulfill the latter requirement, and I'm thinking could fulfill the former requirement.
A unique-id is somewhat parallel to the proposed GUID, but somewhat different in purpose. The GUID is intended to identify "same as" when an object has been serialized and deserialized and thus has a different "handle". Unique-id is the flip of this, i.e., identifying that the query currently occupying a handle is not the same query as previously occupied the handle. But, close enough in meaning that I wouldn't object to them calling the property unique-id instead.
This is quite different than hashcode, however, which is used to identify that two objects have the same state even though they are not the same instance. This concept doesn't really apply to something like a query unless you considered things like the current cursor position and any other state aspects of the query in the comparison. Moreover, the whole point of hashcode is to compare objects which are not the same instance. That would be like having two queries with different handles but the same where clause, lock state, cursor position, etc.
"0000004046 – Add WRITE-XML and READ-XML to Progress.Lang.Object"
This should closely follow the JAXB 2.2 model where serialization is done means of annotations. One should be able to mark what is added as an element and what is added as an attribute. It should also be possible to specify a root element for the class as a whole.
Rather than annotations per se, my inclination is to go along with the mechanisms that we have elsewhere for WRITE-XML like XML-NODE-TYPE.
What else do you want?
How is the root something other than the class itself?