From: stephan b. <st...@ei...> - 2003-10-10 11:41:08
|
Another holy grail: the serializableClass()/implClass() stuff is /no longer needed/!!! It builds the class names database at run-time via the INSTANTIATOR macro, typeid() and some weird template code. This reduces the copies of the class names to 1 per serializable type instead of one per instance (well, okay, 2 or 3 per type, because they're mapped a couple different ways in some global maps). i've found that i do get different typeid(Foo).name()s in different contexts, however, and i'm not sure yet if that will break this approach. So far, so good, anyway. By the way: Serializable is now a more general term for classes meeting a general interface, not a specific class. Any type can be Serializable by simply implementing two functions and doing a macro call to map their functions to a SerializableAdapter, which will then be used by the core to marshall the calls between the two APIs. Since it's inlined template code the theoretical runtime cost is zero. i /may/ put the serializableClass() stuff back in, only because it makes it easy to map aliases for your types, but the current framework supports that as well, so i may just leave it out. It has always been the bastard stepchild of the whole model, anyway. It is SO easy to mix different Serializable types now, even if they have different physical interfaces, because it's all mediated by an Adapter class (should that be Adaptor?) which translates the APIs. Casting is a thing of the past, too - there is /not one single cast/ in the core/classloader, and it's 100% compile-time safe! It's essentially impossible to load a class of the wrong type! The classloading model turns classloading on it's head - AFAIK this approach has never been used before... but i LOVE how it's turning out. This has been the absolute best Zen Coding week of my life. Since last Sunday at Midnight i have only slept 9(!) hours and i feel just great because this code is turning out to be the best things i've ever written, and that just turns me on. :) :) :) (too little sleep and the mind goes, eh?) -- ----- st...@ei... - http://www.einsurance.de "... NOT because we are America's poodle ..." Tony Blair, 30.9.2003 |