Skip to content
wezside edited this page Oct 25, 2011 · 5 revisions

The Toolkit started as a means of the DRY (Don't repeat yourself) principle. Re-usability in code has become quite important as the time-line for projects shrink. It's also considered to be a great time saver for mundane tasks which face developers when building Flash applications. This is not a framework, it's a Toolkit that sports a component architecture.

###The Core The Toolkit very much revolves around a core component architecture. This fundamentally is based on the Composition Design Pattern if you consider the component within it's own context. A simple Iterator pattern is used to manage all data structures through collections. Throughout the Toolkit, collections are preferred over native data structures. For example the children of a component can be iterated over by simply asking for an IIterator through the iterator() method.

UIElement is essentially a composite element. This means it can be a tree like structure, i.e. elements may contain new instances of elements until you reach the leaf. A UIElement consist of 3 factory template methods which depicts the life cycle of any UIElement component. These 3 abstarct methods are not called using the traditional factory template. The decision was made to remove the template method to allow for greater transparency of the component life cycle. This is something which may change as various devs find this concept difficult to understand.

###The Life Cycle

  • build()
  • setStyle()
  • arrange()

This is the life cycle of any UIElement. The build method simply creates the instances and adds any display objects to the display list. The setStyle method is used to apply any CSS values. The arrange method is used to invoke any layout that is needed.

###Build requirements There are no build requirements.

###Set style requirements To use the CSS value injection an instance of IStyleManager is required. The StyleManager is simply a class which contains an embedded CSS file. The UIElement styleManager property is needed for use with setStyle().

###Arrange requirements The default is none. However various layout decorators exists to align all child elements to be arrange in a specific way. Read more about Decorators here.

Clone this wiki locally