From: Mike R. <mik...@gm...> - 2007-08-16 09:16:30
|
Here is the game plan I recently outlined: 1) Create class messages ("static" messages). This is easy. 2) Reorganize the object creation process. Get some memory with the 'alloc' class message, then init the object with the init method (which still automatically calls parent constructors and such). This is what we do right now: an alloc *method*, not message, gets some memory with calloc(), calls the init method, and returns a properly formed object. So the old way could be referred to as "ass-backwards"... if you will. I'll fix it. 3) Then I'll get rid of the "memory" module or whatever by bringing the memory management in as SObject methods. There's no real need to make retain/release/auto_release messages. You just need the 'alloc' class message and a corresponding 'free' message. 4) Next I'll carefully create a true base class that contains only the bare minimum for a top-level Sooc class. I'll get rid of all the hackish code that is SObject and rewrite the boilerplate in terms of Sooc macros so it will be a genuine abstract class. 5) When the base system finally makes sense, I'll start rewriting all the method prototypes to use typed parameter pointers, while continuing to use generic self- and return-value-pointers. Tonight I finished 1-4. It went rather well. The base class is SMeta. SIface is more elegant because it uses SMetaClass as a base (just as SObject and SObjectClass build on SMeta and SMetaClass). Externally managed objects are now possible with s_ext_bless() before use and s_ext_clean() after. [Note: I was referring to these as unmanaged earlier, with s_unmanaged_bless() and s_unmanaged_clean(), but those names were confusing and unnecessarily long.] So it's time for an updated Game Plan. -Mike |