Menu

#457 Consider adding a second class initialization method

v4.2.0
closed
Classes (154)
complete
5
2014-04-15
2012-06-08
No

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.

Discussion

  • Rick McGuire

    Rick McGuire - 2012-06-13

    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.

     
  • Rick McGuire

    Rick McGuire - 2012-08-27
    • status: open --> accepted
    • assigned_to: Rick McGuire
    • pending_work_items: --> code+doc+test
     
  • Rick McGuire

    Rick McGuire - 2014-04-15
    • status: pending --> closed
     

Anonymous
Anonymous

Add attachments
Cancel