This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 21111 - Improvement of data serialization
Summary: Improvement of data serialization
Status: RESOLVED WONTFIX
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 3.x
Hardware: PC Linux
: P3 blocker (vote)
Assignee: Martin Matula
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-03-04 08:00 UTC by Svata Dedic
Modified: 2002-07-19 15:23 UTC (History)
0 users

See Also:
Issue Type: TASK
Exception Reporter:


Attachments
Serialization patch for the existing files (35.36 KB, patch)
2002-03-04 08:01 UTC, Svata Dedic
Details | Diff
Newly introduced file (src/org/netbeans/mdr/storagemodel/AttributeIOHelper.java) (15.86 KB, text/plain)
2002-03-04 08:02 UTC, Svata Dedic
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Svata Dedic 2002-03-04 08:00:11 UTC
The patch works on an assumption, that a ClassProxy defines layout of instance's
attribute values, and that StorableObjects do not alter this layout.
StorableClass is inspected for attributes after it is created and the attributes
are assigned a serialCode (similar to T_ constants in IOUtils). The
serialization code then switches on this tag instead of on instanceof; it also
does not need to emit type tags into the serialized stream.
EnumImpl is patched to not generate impls for RefEnums, rather to locate/load
them  using reflection. It also adds to the serialization patch' effect by
encoding Enums into integer values. The mapping is recreated at runtime.
Comment 1 Svata Dedic 2002-03-04 08:01:09 UTC
Created attachment 4911 [details]
Serialization patch for the existing files
Comment 2 Svata Dedic 2002-03-04 08:02:06 UTC
Created attachment 4912 [details]
Newly introduced file (src/org/netbeans/mdr/storagemodel/AttributeIOHelper.java)
Comment 3 Martin Matula 2002-03-06 20:15:56 UTC
Hi Svata. I reviewed the patch and applied some portions of it. 
Especially the improvements made to IOUtils (separate methods for all 
kinds of types). However I found an alternative way of the serialization of 
enumerations that is more in line with another change I wanted to make 
(serialization of datatype descriptors) and I also could not apply most of 
the changes made to get rid of tags when serializing attribute values. 
The whole idea is good - especially the thing with remembering 
the "type number" and then using "switch" instead of "instanceof" to 
decide which serialization to use is cool - I will probably come back to it 
later and fix the patch, however currently the patch is incorrect (it does 
not cover the case when attributes of primitive types contain "null" which 
is possible in MOF especially if the lower multiplicity bound is 0). 
Currently I just don't have enough energy and time to fix it since it is not 
of that high priority - I doubt that it will be a significant performance 
improvement - I admit that this may get a higher priority once I will finish 
implementation of events and the simple transactions. In the meantime I 
made some other performance improvements (got rid of another MOFID 
(immediatePackage) from StorableObject, rewritten all the serialization 
to use the new specific serialization methods in IOUtils, improved 
resolving of datatypes)