Dead Ink Vinyl

Musings of David L Kinney

Posts Tagged ‘opensource

Closed systems still win

The most insightful thing I’ve read in a while comes from Brian Prentice’s analysis of Jonathan Rosenberg’s The Meaning of Open:

The truth is that closed systems still win. Open systems, practically speaking, are basically good for making others lose. The art of business in the 21st century is figuring out how to open up your suppliers’ and competitors’ business while keeping yours tightly sealed. And in that endeavor Google has proven highly successful.

Written by dlkinney

December 22, 2009 at 2:42 pm

Flex 3 addChild() and initialize()

Okay, I’ve walked through all of the code in UIComponent and Container to work this out, so I’m going to share it: the sequence of operations when addChild(child) is invoked on a container and child extends UIComponent.

Since the primary use for this knowledge is managing the initialization portion of the component life cycle, I’ve highlighted the lines where your component may extend the behavior of UIComponent to perform its own operations.

The addChild() code bounces around through a lot of the Container class hierarchy, so I’ve included the class name with the method calls inside the parent’s instance so that you know where in the class hierarchy things get handled.

For simplicity, I skip showing the parameters to method calls and I don’t expand some operations (depicted by italicized text).

  1. Container.addChild()
    1. calls Container.addChildAt()
      1. removes child’s previous parent, if present
      2. calls Container.addingChild()
        1. calls UIComponent.addingChild()
          1. calls child.parentChanged()
          2. performs style setup on child
          3. calls child.stylesInitialized()
        2. invalidates size and display list of parent
      3. calls UIComponent.$addChildAt()
        1. calls Sprite.addChild()
      4. calls Container.childAdded()
        1. parent dispatches “childrenChanged”
        2. parent dispatches “childAdd”
        3. calls child.dispatchEvent()
          1. child dispatches “add”
        4. calls UIComponent.childAdded()
          1. calls child.initialize()
            1. dispatches “preinitialize”
            2. calls child.createChildren()
            3. calls child.childrenCreated()
              1. invalidates properties, size, and display list of child
            4. calls child.initializeAccessibility()
            5. calls child.initializationComplete()
              1. sets processedDescriptors = true
                1. dispatches “initialize”

There you have it: the order of operations when you invoke Container.addChild(). I hope this proves useful.

Written by dlkinney

October 5, 2008 at 12:21 am

iPhone OpenGL ES [UPDATED]

Brad Larson of Sunset Lake Software and creator of Molecules gave an excellent presentation about OpenGL ES development for the iPhone at iPhoneDevCamp Chicago this past weekend. Today, he posted the non-NDA-breaking highlights of his presentation online. It’s an excellent resource for anyone starting out with OpenGL development. I find it very inspiring that someone can go from “I know nothing about OpenGL” to finished application in three weeks working only nights and weekends.

UPDATE: With the NDA lifted, Brad has generously released the source code for Molecules!

Written by dlkinney

August 6, 2008 at 9:15 pm