5 Aug 17:51
[groovy-dev] Closure, Registry and MetaClass serialization
From: Jochen Theodorou <blackdrag@...>
Subject: [groovy-dev] Closure, Registry and MetaClass serialization
Newsgroups: gmane.comp.lang.groovy.devel
Date: 2008-08-05 15:55:24 GMT
Subject: [groovy-dev] Closure, Registry and MetaClass serialization
Newsgroups: gmane.comp.lang.groovy.devel
Date: 2008-08-05 15:55:24 GMT
Hi all, before I go and commmit my serialization code there are a few things we should maybe discuss. I made several tries for the serialization code which is the reason why it took me so long. Any way, in the last version I decided to not to do a full serialization of all things, but go with a mixed serialization/recreation technique. What I try to avoid is making our custom data structures part of the serialization process. The reason behind this is, that they seem not to be stable enough and are part of many changes. The problem with serialization now is, that if a field has for example has one of our has maps with two keys and is final, then I can not serialize the class unless I serialize that data structure or remove the final. I decided for removing final, but the result is then of course a change in runtime performance. One of my biggest problems was serializing MetaMethod, because it is coupled very tightly to many internal data structures. So what I serialize is Closure and variant of Closure, including subclasses generated by the compiler. I can serialize the registry along with MetaClassImpl and ExpandoMetaClass, but serializing modifications to EMC will be possible only if the method/property was added using the builder Alex made, or the old foo.metaClass.bar = ... style. I somehow broke mixins somewhere, I still have to fix that, but I guess serializing them is possible too. What won't be serializable is when custom MetaMethods are added. Also(Continue reading)
RSS Feed