Difference between revisions of "Class Structure Hash"

(New page: Purpose: A request for comments on the notion of various equality tests for a class. The tests can be used in areas such as serialization, proxy/stub calls, versioning, dynamic type loadi...)
 
Line 1: Line 1:
Purpose: A request for comments on the notion of various equality tests for a class.  The tests can be used in areas such as serialization, proxy/stub calls, versioning, dynamic type loading, etc.
+
'''Purpose:'''<br/>
 +
A request for comments on the notion of various equality tests for a class.  The tests can be used in areas such as serialization, proxy/stub calls, versioning, dynamic type loading, etc.
  
 
Hash value are a SHA256 hash
 
Hash value are a SHA256 hash
  
Class-text hash:
+
'''Class-text hash:'''<br/>
- Complete hash of the text of the class.  Any change including non-processed areas such as `note' or comments would cause the hash value to change.
+
* Complete hash of the text of the class.  Any change including non-processed areas such as `note' or comments would cause the hash value to change.
  
Semantic-text hash:
+
'''Semantic-text hash:'''<br/>
- Hash value of the semantically-meaningful text of the class.  This would ignore the actual character contents of breaks and would ignore comments and note fields.  If a buggy version of a class is discovered, it could be rejected for serialization or connection by this hash value.
+
* Hash value of the semantically-meaningful text of the class.  This would ignore the actual character contents of breaks and would ignore comments and note fields.  If a buggy version of a class is discovered, it could be rejected for serialization or connection by this hash value.
  
Attribute hash:
+
'''Attribute hash:'''<br/>
- Hash value of the attributes of the class.  This would essentially mean anything with an equal attribute hash could be deserialized/serialized without recovery.
+
* Hash value of the attributes of the class.  This would essentially mean anything with an equal attribute hash could be deserialized/serialized without recovery.
  
Feature hash:
+
'''Feature hash:'''<br/>
- Name, signature, and export hash for a feature
+
* Name, signature, and export hash for a feature
  
Interface-to-class hash:
+
'''Interface-to-class hash:'''<br/>
- Hash value of feature names and signature exported to a specific class.  This would be useful for remote proxying.  A class would have a additional value for each class to which features are exported.  If class A exports features to {ANY}, {A}, {B}, and {NONE} it would have a hash value for each to say whether the interface exported to either ANY, A, or B has changed.  Changes to features exported to A would affect the hash code for {ANY} and {A} but not {B}.  Changes to features exported to NONE would not affect any hash values.
+
* Hash value of feature names and signature exported to a specific class.  This would be useful for remote proxying.  A class would have a additional value for each class to which features are exported.  If class A exports features to {ANY}, {A}, {B}, and {NONE} it would have a hash value for each to say whether the interface exported to either ANY, A, or B has changed.  Changes to features exported to A would affect the hash code for {ANY} and {A} but not {B}.  Changes to features exported to NONE would not affect any hash values.
  
Contract hash:
+
'''Contract hash:'''<br/>
- A hash value for a the contract of a feature.
+
* A hash value for a the contract of a feature.
  
Interface-to-class contract hash:
+
'''Interface-to-class contract hash:'''<br/>
- A hash value for the contract of all features exported to a class.
+
* A hash value for the contract of all features exported to a class.
  
Additional issues:
+
'''Additional issues:'''<br/>
- Mutual recursive references.  In some cases two classes reference each other; this could lead to difficulty in creating a hash value for both.
+
* Mutual recursive references.  In some cases two classes reference each other; this could lead to difficulty in creating a hash value for both.<br/>
- Some traditionally non-semantic areas such as `note' actually have semantic value.
+
* Some traditionally non-semantic areas such as `note' actually have semantic value.<br/>
- Are 256 bits needed?  Maybe truncate hash to 128 bits or 64 bits.
+
* Are 256 bits needed?  Maybe truncate hash to 128 bits or 64 bits.

Revision as of 09:35, 5 March 2010

Purpose:
A request for comments on the notion of various equality tests for a class. The tests can be used in areas such as serialization, proxy/stub calls, versioning, dynamic type loading, etc.

Hash value are a SHA256 hash

Class-text hash:

  • Complete hash of the text of the class. Any change including non-processed areas such as `note' or comments would cause the hash value to change.

Semantic-text hash:

  • Hash value of the semantically-meaningful text of the class. This would ignore the actual character contents of breaks and would ignore comments and note fields. If a buggy version of a class is discovered, it could be rejected for serialization or connection by this hash value.

Attribute hash:

  • Hash value of the attributes of the class. This would essentially mean anything with an equal attribute hash could be deserialized/serialized without recovery.

Feature hash:

  • Name, signature, and export hash for a feature

Interface-to-class hash:

  • Hash value of feature names and signature exported to a specific class. This would be useful for remote proxying. A class would have a additional value for each class to which features are exported. If class A exports features to {ANY}, {A}, {B}, and {NONE} it would have a hash value for each to say whether the interface exported to either ANY, A, or B has changed. Changes to features exported to A would affect the hash code for {ANY} and {A} but not {B}. Changes to features exported to NONE would not affect any hash values.

Contract hash:

  • A hash value for a the contract of a feature.

Interface-to-class contract hash:

  • A hash value for the contract of all features exported to a class.

Additional issues:

  • Mutual recursive references. In some cases two classes reference each other; this could lead to difficulty in creating a hash value for both.
  • Some traditionally non-semantic areas such as `note' actually have semantic value.
  • Are 256 bits needed? Maybe truncate hash to 128 bits or 64 bits.