From: SourceForge.net <no...@so...> - 2012-06-13 18:53:37
|
Feature Requests item #3533581, was opened at 2012-06-08 12:03 Message generated for change (Comment added) made by bigrixx You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=684733&aid=3533581&group_id=119701 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Classes Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Rick McGuire (bigrixx) Assigned to: Nobody/Anonymous (nobody) Summary: Consider adding a second class initialization method Initial Comment: The life cycle of class instantiating class objects created from directives goes through a multi-stage process where a class object gets created, then the various instance method dictionaries get built from the class hierarchy and inherited mixins. Unfortunately, this means it is not possible for the class INIT method to create instances of itself at the point where it is called. This is very much a chicken-and-egg situation here and I believe this really cannot be changed. However, it should be possible to define a new method on class (SETUP maybe?) that is called after the class object is fully resolved and ready for use. This additional method would only apply to class objects created from directives, not to ones created by manual use of the various class methods. This last case is extremely rare...really those methods are only used by the internal directive processing in the first place. This addition will make it possible for a class to create singletons of itself during class initialization rather than being forced to delay things until a triggering method call occurs. ---------------------------------------------------------------------- >Comment By: Rick McGuire (bigrixx) Date: 2012-06-13 11:53 Message: Realized there should be an additional requirement to this method callback. This should occur after all other classes in the same package have been processed, ensuring access to all classes defined in the same package. This should be done before the package initialization code is called. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=684733&aid=3533581&group_id=119701 |