This identifier must also implicit regard on the fields which are relevant for this object. We must also provide a functionality, which can be executed by both, sender and recipient, to identify an object. Once it is created by the sender, it is not reproducible. Also our recipient cannot "create" a GUID on his own. Otherwise our recipient of the object cannot be sure, that he has received / deserialized the same object. Implicitly this identifier must also represent some internal values like state. What we need is not an identifier for the class, we need an identifier for each instance of the class. This struct can be used to give each class its own identifier. NET Framework gives us a struct to uniquely identify our objects, the System.Guid struct in the mscorlib.dll. were deserialized correctly (see Background for explanation).Ī commonly used technique in the Internet is to provide a MD5 - Hash String so the receiver can compare if the file has been transmitted without any modifications. But in this way, you cannot be sure that the internal states, etc. A possible solution to this problem is using the System.Guid struct to identify the objects. ![]() Especially if you have objects which have internal states or if you must manage multiple instances of a class. Now it can be useful if we would know after the deserializing process, if the object has been restored correctly. to send them over a network, store and restore them locally or for any other reason. ![]() Sometimes we have to serialize objects, e.g.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |