<?xml version='1.0' encoding='UTF-8'?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'><id>tag:blogger.com,1999:blog-18955489</id><updated>2008-02-04T02:08:58.780-08:00</updated><title type='text'>Gugga Flash Framework</title><link rel='alternate' type='text/html' href='http://www.gugga.com/flashblog/'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18955489/posts/default'/><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://www.gugga.com/flashblog/atom.xml'/><author><name>sotirov</name></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>11</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-18955489.post-3355350321796398731</id><published>2007-09-20T06:06:00.000-07:00</published><updated>2007-09-20T06:23:53.242-07:00</updated><title type='text'>GuggaFF is now on ActionScript 3.0</title><content type='html'>We this new feature we would like to announce our long anticipated plans for moving the Gugga Flash framework to ActionScript 3.0 have become a reality and we can share  its first alfa release. This turned out to be a very complicated task since the whole concept of making interactive sites and applications with Flash is changing completely with the release of Flex 2 and Flash CS3.  That’s why we decided to identify the unique features that we believe will continue to exist and will contribute most to the whole development process, and port them first. &lt;br /&gt;&lt;br /&gt;The primary features which we decided to include in this first ActionScript 3.0 release of the framework is the Tasks Engine. Along with it are included some other aspects which support its functionality such as Collections, Logging and variety of utilities. &lt;br /&gt;&lt;br /&gt;Tasks engine is very powerful and in the same time its abstract enough. It can be combined with different concepts already included in Flex and Flash CS3. One can imagine tools combining XML defined animations from Flash CS3 and effects from Flex wrapped and included in a GuggaFF task sequence or sequences wrapped and used as effect in Flex. &lt;br /&gt;There are still no implemented wrappers for doing so but they are possible to implement and will probably be included in some of the next releases.&lt;br /&gt;&lt;br /&gt;Our major goal is to provide a full featured framework which will complement the Adobe’s suite of tools for creating interactive sites and applications. The scope and concepts of the framework will change over time as the basis of the tools we currently have has changed so much but we promise that all that we learn will be shared, with more examples and refined best practices.&lt;br /&gt;&lt;br /&gt;You can download the new alfa release from here:&lt;br /&gt;&lt;a href="http://www.gugga.com/GuggaFlashFramework/"&gt;Alfa Version 2.0 alfa&lt;/a&gt;</content><link rel='alternate' type='text/html' href='http://www.gugga.com/flashblog/2007/09/guggaff-is-now-on-actionscript-30.html' title='GuggaFF is now on ActionScript 3.0'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18955489&amp;postID=3355350321796398731' title='2 Comments'/><link rel='replies' type='application/atom+xml' href='http://www.gugga.com/flashblog/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18955489/posts/default/3355350321796398731'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18955489/posts/default/3355350321796398731'/><author><name>sotirov</name></author></entry><entry><id>tag:blogger.com,1999:blog-18955489.post-99218415073515705</id><published>2007-06-26T04:46:00.000-07:00</published><updated>2007-06-27T09:09:26.817-07:00</updated><title type='text'>Building multimarket applications with Gugga Flash Framework.</title><content type='html'>&lt;span style="font-style:italic;"&gt;Creating applications with dynamic structure.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;With this new article we would like to offer you a flexible solution for creating a Multimarket-Multilanguage Flash Applications using GuggaFF. We will see how such RIAs  can achieve a  highly flexible and extensible structure accommodating future changes and updates. Based on our own experience, those kind of applications are usually requested to serve specific business reasons providing customized information to many markets in different languages. Let summarize the requirements for our application&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;provide customized information and functionality to more then one market in more then one language&lt;/li&gt;&lt;br /&gt;&lt;li&gt;allow for transparent update of information without the need to recompile the application&lt;/li&gt;&lt;br /&gt;&lt;li&gt;ability to quickly release or disable whole sections of the application during its lifespan&lt;/li&gt;&lt;br /&gt;&lt;li&gt;build and release new markets and languages without jeopardizing the existing functionality and without rewriting the application&lt;/li&gt;&lt;br /&gt;&lt;li&gt;allow for creating Accessible versions of the applications reusing the existing content&lt;/li&gt;&lt;br /&gt;&lt;li&gt;allow for transparent introduction of a content management system to support the  application&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;Sounds familiar ….?&lt;br /&gt;Ok let’s look at the two important aspects of our application that make it so unique as a requirement. &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Market&lt;/span&gt;&lt;br /&gt;A very common scenario is that different markets involve different structure of the application at the same time there is usually a significant overlap and  single section is found among more than one market. Hence, market determines a set of  sections with specific structure. &lt;br /&gt;&lt;span style="font-style:italic;"&gt;Please, remember that Gugga Flash Framework introduces Sections and SectionsControllers as the building blocks of an application. &lt;br /&gt;Take a look at them, if they are new to you!&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Language&lt;/span&gt;&lt;br /&gt;Language is usually a function of the content displayed in the site. We will assume that all the content in our application will be external to it and will either be held in static XML files or in a Data Base.&lt;br /&gt;&lt;br /&gt;Our goal is to create a single application which supports variable sections structure, in order to represent different markets. We strive to reach the lowest development cost in the long term and preserve high quality on a large scale.&lt;br /&gt;&lt;br /&gt;The main architectural problems our solution is faced with are:&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;How to define flexible application structure, which also allows transparent creation of   new markets?&lt;/li&gt;&lt;br /&gt;&lt;li&gt;How to implement an application which supports variable section structures?&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;How to define flexible application structure, which also allows transparent creation of new markets&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Our best approach in defining the sections structure is to use &lt;span style="font-weight:bold;"&gt;xml &lt;/span&gt;format. It is &lt;span style="font-weight:bold;"&gt;hierarchical &lt;/span&gt;and matches the &lt;span style="font-weight:bold;"&gt;composite structure&lt;/span&gt; of the sections. Its &lt;span style="font-weight:bold;"&gt;declarative &lt;/span&gt;style allows even &lt;span style="font-weight:bold;"&gt;non-developer&lt;/span&gt; to create and control it. More importantly, the xml format brings formal sense to the key abstraction of an application &lt;span style="font-weight:bold;"&gt;structure&lt;/span&gt;. It also ensures that the application is completely abstracted of its current structure. For convenience proposes we will call that xml file &lt;span style="font-weight:bold;"&gt;structure.xml&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Let’s start with declaring the main building block of our application - the section within the structure.xml. We will create a &lt;span style="font-weight:bold;"&gt;&lt;section&gt;&lt;/span&gt; node which will basically need: &lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-weight:bold;"&gt;id &lt;/span&gt;– identifier of the section. It will be used in the section paths used by GuggaFF navigation mechanism&lt;br /&gt;&lt;span style="font-style:italic;"&gt;Please, remember that every section within the composite is identified by a dot-notated section path. NavigationCommands are used to navigate section paths.&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-weight:bold;"&gt;type&lt;/span&gt; – &lt;span style="font-style:italic;"&gt;on_stage&lt;/span&gt;, &lt;span style="font-style:italic;"&gt;lazy_attach&lt;/span&gt;  or &lt;span style="font-style:italic;"&gt;lazy_load&lt;/span&gt; depending on that if the section is on the application stage or in the application library or in external swf file. GuggaFF supports all types of sections by &lt;span style="font-style:italic;"&gt;registerChildSection&lt;/span&gt;, &lt;span style="font-style:italic;"&gt;registerLazyAttachSection&lt;/span&gt; and &lt;span style="font-style:italic;"&gt;registerLazyLoadSection&lt;/span&gt; methods of  the SectionsController class. The &lt;span style="font-style:italic;"&gt;on_stage&lt;/span&gt; type of section is not the best approach if we want a  flexible solution but in some very special cases (ex. when we want to abstract a block of sections which always go together) we can use it. This kind of sections are opening faster, because they are loaded and initialized in advance.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-weight:bold;"&gt;instance&lt;/span&gt; – For on_stage type of sections.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;symbol_identifier – For lazy_attach type of sections.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-weight:bold;"&gt;swf_path&lt;/span&gt; – For lazy_load type of sections.&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;Here is a sample node of a generic section declaration:&lt;br /&gt;&lt;br /&gt;&amp;lt;section id="&lt;span style="font-weight:bold;"&gt;Home&lt;/span&gt;" symbol_identifier="&lt;span style="font-weight:bold;"&gt;HomeSection&lt;/span&gt;" type="lazy_&lt;span style="font-weight:bold;"&gt;attach&lt;/span&gt;"&amp;gt;&lt;br /&gt;      &amp;lt;section id=”SubSection” … &amp;lt;/section&amp;gt;&lt;br /&gt;&amp;lt;/section&amp;gt;&lt;br /&gt;If we could point any drawbacks of this solution, it is that we should have separate structures even for identical markets. But this is a cheap price to be paid!&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;How to implement an application which supports variable section structures&lt;/span&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.gugga.com/GuggaFlashFramework/samples/images/dynamic_structure.gif"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;" src="http://www.gugga.com/GuggaFlashFramework/samples/images/dynamic_structure.gif" border="0" alt="" /&gt;&lt;/a&gt; &lt;br&gt;&lt;br /&gt;In GuggaFF every SectionsController registers its child sections. Given that, we need SectionsControllers which accept &lt;span style="font-weight:bold;"&gt;structure data(coming from structure.xml)&lt;/span&gt; which they will use to register their child sections. We will subclass SectionsController and this will bring a new quality to the composite entity – the ability to be created dynamically.&lt;br /&gt;&lt;br /&gt;Here is some &lt;span style="font-weight:bold;"&gt;pseudo &lt;/span&gt;code to illustrate the idea.&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;Interface extension for composite nodes:&lt;br /&gt;&lt;pre&gt;&lt;span class="keyword"&gt;interface&lt;/span&gt; sections&lt;span class="operator"&gt;.&lt;/span&gt;IBaseSection&lt;span class="keyword"&gt; extends&lt;/span&gt; ISection&lt;span class="operator"&gt; &lt;br /&gt;&lt;br /&gt;{&lt;/span&gt;&lt;span class="keyword"&gt;&lt;br /&gt;   public function&lt;/span&gt; setStructureData&lt;span class="operator"&gt;(&lt;/span&gt;aData&lt;span class="operator"&gt; :&lt;/span&gt; SectionStructureData&lt;span class="operator"&gt;) :&lt;/span&gt;&lt;span class="iden"&gt; Void&lt;/span&gt;&lt;span class="operator"&gt;;&lt;br /&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Subclass of SectionsController to carry out the structure data and register child sections:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;span class="keyword"&gt;class&lt;/span&gt; configuration&lt;span class="operator"&gt;.&lt;/span&gt;SectionStructureData&lt;span class="operator"&gt; &lt;br /&gt;&lt;br /&gt;{&lt;/span&gt;&lt;span class="keyword"&gt;&lt;br /&gt;   public var&lt;/span&gt; ID&lt;span class="operator"&gt; :&lt;/span&gt;&lt;span class="iden"&gt; String&lt;/span&gt;&lt;span class="operator"&gt;;&lt;/span&gt;&lt;span class="keyword"&gt;&lt;br /&gt;   public var&lt;/span&gt; Type&lt;span class="operator"&gt; :&lt;/span&gt;&lt;span class="iden"&gt; String&lt;/span&gt;&lt;span class="operator"&gt;;&lt;/span&gt;&lt;span class="keyword"&gt;&lt;br /&gt;&lt;br /&gt;   public var&lt;/span&gt; SymbolIdentifier&lt;span class="operator"&gt; :&lt;/span&gt;&lt;span class="iden"&gt; String&lt;/span&gt;&lt;span class="operator"&gt;;&lt;/span&gt;&lt;span class="keyword"&gt;&lt;br /&gt;   public var&lt;/span&gt; Swf&lt;span class="operator"&gt; :&lt;/span&gt;&lt;span class="iden"&gt; String&lt;/span&gt;&lt;span class="operator"&gt;;&lt;/span&gt;&lt;span class="keyword"&gt;&lt;br /&gt;&lt;br /&gt;   public var&lt;/span&gt; Instance&lt;span class="operator"&gt; :&lt;/span&gt;&lt;span class="iden"&gt; String&lt;/span&gt;&lt;span class="operator"&gt;;&lt;/span&gt;&lt;span class="keyword"&gt;&lt;br /&gt;   public var&lt;/span&gt; Subsections&lt;span class="operator"&gt; :&lt;/span&gt;&lt;span class="iden"&gt; Array&lt;/span&gt;&lt;span class="operator"&gt;;&lt;/span&gt;&lt;span class="keyword"&gt;&lt;br /&gt;&lt;br /&gt;   public var&lt;/span&gt; SectionPath&lt;span class="operator"&gt; :&lt;/span&gt;&lt;span class="iden"&gt; String&lt;/span&gt;&lt;span class="operator"&gt;;&lt;br /&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Subclass of SectionsController to carry out the structure data and register child sections:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;span class="keyword"&gt;class&lt;/span&gt; sections&lt;span class="operator"&gt;.&lt;/span&gt;BaseSectionsController&lt;span class="keyword"&gt; extends&lt;/span&gt; SectionsController&lt;span class="keyword"&gt; implements&lt;/span&gt; IBaseSection&lt;span class="operator"&gt; &lt;br /&gt;&lt;br /&gt;{&lt;/span&gt;&lt;span class="keyword"&gt;&lt;br /&gt;   public function&lt;/span&gt; setStructureData&lt;span class="operator"&gt;(&lt;/span&gt;aData&lt;span class="operator"&gt; :&lt;/span&gt; SectionStructureData&lt;span class="operator"&gt;) :&lt;/span&gt;&lt;span class="iden"&gt; Void&lt;/span&gt;&lt;span class="operator"&gt; &lt;br /&gt;   {&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;      mStructureData&lt;span class="operator"&gt; =&lt;/span&gt; aData&lt;span class="operator"&gt;;&lt;/span&gt;&lt;span class="keyword"&gt;&lt;br /&gt;      &lt;br /&gt;      var&lt;/span&gt; subsectionsStructureData&lt;span class="operator"&gt; :&lt;/span&gt;&lt;span class="iden"&gt; Array&lt;/span&gt;&lt;span class="operator"&gt; =&lt;/span&gt; aData&lt;span class="operator"&gt;.&lt;/span&gt;Subsections&lt;span class="operator"&gt;;&lt;/span&gt;&lt;span class="keyword"&gt;&lt;br /&gt;&lt;br /&gt;      for&lt;/span&gt;&lt;span class="operator"&gt; (&lt;/span&gt;&lt;span class="keyword"&gt;var&lt;/span&gt; i&lt;span class="operator"&gt; :&lt;/span&gt;&lt;span class="iden"&gt; Number&lt;/span&gt;&lt;span class="operator"&gt; =&lt;/span&gt;&lt;span class="num"&gt; 0&lt;/span&gt;&lt;span class="operator"&gt;;&lt;/span&gt; i&lt;span class="operator"&gt; &amp;lt;&lt;/span&gt; subsectionsStructureData&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="iden"&gt;length&lt;/span&gt;&lt;span class="operator"&gt;;&lt;/span&gt; i&lt;span class="operator"&gt;++)&lt;br /&gt;      {&lt;/span&gt;&lt;span class="keyword"&gt;&lt;br /&gt;&lt;br /&gt;         var&lt;/span&gt;&lt;span class="iden"&gt; data&lt;/span&gt;&lt;span class="operator"&gt; :&lt;/span&gt; SectionStructureData&lt;span class="operator"&gt; =&lt;/span&gt; &lt;br /&gt;            SectionStructureData&lt;span class="operator"&gt;(&lt;/span&gt;subsectionsStructureData&lt;span class="operator"&gt;[&lt;/span&gt;i&lt;span class="operator"&gt;]);&lt;/span&gt;&lt;span class="keyword"&gt;&lt;br /&gt;&lt;br /&gt;         &lt;br /&gt;         if&lt;/span&gt;&lt;span class="operator"&gt;(&lt;/span&gt;&lt;span class="iden"&gt;data&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;Type&lt;span class="operator"&gt; !=&lt;/span&gt;&lt;span class="string"&gt; "on_stage"&lt;/span&gt;&lt;span class="operator"&gt;)&lt;br /&gt;         {&lt;/span&gt;&lt;br /&gt;            mSectionLoadersCount&lt;span class="operator"&gt;++;&lt;/span&gt;&lt;span class="keyword"&gt;&lt;br /&gt;            var&lt;/span&gt; sectionLoader&lt;span class="operator"&gt; :&lt;/span&gt; ISectionLoader&lt;span class="operator"&gt; =&lt;/span&gt; &lt;br /&gt;               createSectionLoader&lt;span class="operator"&gt;(&lt;/span&gt;&lt;span class="iden"&gt;data&lt;/span&gt;&lt;span class="operator"&gt;,&lt;/span&gt;&lt;span class="string"&gt; "sectionLoader_"&lt;/span&gt;&lt;span class="operator"&gt;  +&lt;/span&gt;&lt;span class="iden"&gt; data&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;ID&lt;span class="operator"&gt; +&lt;/span&gt;&lt;span class="string"&gt; "_"&lt;/span&gt;&lt;span class="operator"&gt; +&lt;/span&gt; mSectionLoadersCount&lt;span class="operator"&gt;);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;               &lt;br /&gt;            registerLazySection&lt;span class="operator"&gt;(&lt;/span&gt;sectionLoader&lt;span class="operator"&gt;,&lt;/span&gt;&lt;span class="iden"&gt; data&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;ID&lt;span class="operator"&gt;,&lt;/span&gt;&lt;span class="iden"&gt; true&lt;/span&gt;&lt;span class="operator"&gt;);&lt;br /&gt;         }&lt;/span&gt;&lt;span class="keyword"&gt;&lt;br /&gt;         else&lt;/span&gt;&lt;span class="operator"&gt;&lt;br /&gt;&lt;br /&gt;         {&lt;/span&gt;&lt;span class="keyword"&gt;&lt;br /&gt;            var&lt;/span&gt; section&lt;span class="operator"&gt; :&lt;/span&gt;&lt;span class="iden"&gt; Object&lt;/span&gt;&lt;span class="operator"&gt; =&lt;/span&gt; registerChildSection&lt;span class="operator"&gt;(&lt;/span&gt;&lt;span class="iden"&gt;data&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;Instance&lt;span class="operator"&gt;,&lt;/span&gt;&lt;span class="iden"&gt; data&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;ID&lt;span class="operator"&gt;);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;            IBaseSection&lt;span class="operator"&gt;(&lt;/span&gt;section&lt;span class="operator"&gt;).&lt;/span&gt;setStructureData&lt;span class="operator"&gt;(&lt;/span&gt;&lt;span class="iden"&gt;data&lt;/span&gt;&lt;span class="operator"&gt;);&lt;br /&gt;         }&lt;/span&gt;&lt;br /&gt;         &lt;br /&gt;         mSubsectionsStructureData&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="iden"&gt;add&lt;/span&gt;&lt;span class="operator"&gt;(&lt;/span&gt;&lt;span class="iden"&gt;data&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;ID&lt;span class="operator"&gt;,&lt;/span&gt;&lt;span class="iden"&gt; data&lt;/span&gt;&lt;span class="operator"&gt;);&lt;br /&gt;      }&lt;br /&gt;   }&lt;/span&gt;&lt;span class="keyword"&gt;&lt;br /&gt;&lt;br /&gt;   private function&lt;/span&gt; onLazyTargetSectionUIInitialized&lt;span class="operator"&gt;(&lt;/span&gt;ev&lt;span class="operator"&gt;) :&lt;/span&gt;&lt;span class="iden"&gt; Void&lt;/span&gt;&lt;span class="operator"&gt; &lt;br /&gt;   {&lt;/span&gt;&lt;span class="keyword"&gt;&lt;br /&gt;      var&lt;/span&gt; section&lt;span class="operator"&gt; :&lt;/span&gt; IBaseSection&lt;span class="operator"&gt; =&lt;/span&gt; IBaseSection&lt;span class="operator"&gt;(&lt;/span&gt;ev&lt;span class="operator"&gt;.&lt;/span&gt;section&lt;span class="operator"&gt;);&lt;/span&gt;&lt;span class="keyword"&gt;&lt;br /&gt;&lt;br /&gt;      var&lt;/span&gt;&lt;span class="iden"&gt; data&lt;/span&gt;&lt;span class="operator"&gt; :&lt;/span&gt; SectionStructureData&lt;span class="operator"&gt; =&lt;/span&gt; SectionStructureData&lt;span class="operator"&gt;(&lt;/span&gt;&lt;br /&gt;         mSubsectionsStructureData&lt;span class="operator"&gt;[&lt;/span&gt;mTargetSectionID&lt;span class="operator"&gt;]);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;      section&lt;span class="operator"&gt;.&lt;/span&gt;setStructureData&lt;span class="operator"&gt;(&lt;/span&gt;&lt;span class="iden"&gt;data&lt;/span&gt;&lt;span class="operator"&gt;);&lt;br /&gt;   }&lt;br /&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;To use the structre functionality of the BaseSectionsController from classes which derives from SectionsController (ex. ApplicationController), we can use the &lt;span style="font-style:italic;"&gt;Bridge pattern.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;These pseudo-implementations create the foundation of our solution for applications with dynamic structure. Every section which derives from IBaseSection or BaseSectionsController will be of a full value for the application with dynamic structure.&lt;br /&gt;&lt;br /&gt;In next postings we will explain additional aspects of the multimarket applications like, strategies for implementing sections and components, skinning and creating accessible version of a flash site build using GuggaFF.</content><link rel='alternate' type='text/html' href='http://www.gugga.com/flashblog/2007/06/building-multimarket-applications-with.html' title='Building multimarket applications with Gugga Flash Framework.'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18955489&amp;postID=99218415073515705' title='3 Comments'/><link rel='replies' type='application/atom+xml' href='http://www.gugga.com/flashblog/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18955489/posts/default/99218415073515705'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18955489/posts/default/99218415073515705'/><author><name>sotirov</name></author></entry><entry><id>tag:blogger.com,1999:blog-18955489.post-4119625084032102368</id><published>2007-05-14T00:44:00.000-07:00</published><updated>2007-05-14T00:45:50.016-07:00</updated><title type='text'>The new Minor(major) release of  Gugga Flash Framework</title><content type='html'>The new release of the GuggaFF is introducing a number of changes and improvements. The majority are focused on performance increase and improved application model. &lt;br /&gt;&lt;br /&gt;The most significant change in is the Application Architecture. Now the ApplicationController class is a kind of Front Controller for the application. It controls all the transitions in the application and is responsible for the navigation state. Transition starts and interruptions are handled by the ApplicationController so the lower level SectionControllers are no more responsible for this. Their job is to provide the openSection() method and return the transition between the sections they are responsible for. The openSection() method of the ApplicationController should not be called separately. The navigateTo() should be called instead. &lt;br /&gt;&lt;br /&gt;In addition to the ApplicationController changes the navigation’s state can be set by specifying the section path which is currently available. This synchronization is made by the gugga.application.NavigationManager which is commanded by the ApplicationController. Every navigation instance which is registered in the NavigationManager will follow the changes in the application’s section path automatically. &lt;br /&gt;&lt;br /&gt;Having the ApplicationController as a Front Controller gives a much better level of control and synchronization, so now we have much better transitions interruptions. To support all the cases of fast transition changes the navigateTo() method can refuse to open a certain navigation path. In this case it returns false and the corresponding command is not included in the CommandHistory.&lt;br /&gt;&lt;br /&gt;The other major change in this release is that GuggaFF has become almost completely separated from the Macromedia MX framework. We have our own implementation of EventDispatcher with the gugga.events.EventDispatcher class. It uses AsBroadcaster and provides significant increase in performance. In addition, the gugga.common.UIComponentEx is not inheriting mx.core.UIObject. This makes the framework more performing and decreases the time needed to initialize an application. The only link between GuggaFF and MX remains the mx.utils.Delegate class.&lt;br /&gt;&lt;br /&gt;Another big step in increasing the performance is the new gugga.tween package. It provides a lightweight but powerful tween engine. It supports both tweens with frames duration and tweens with time duration. This helps to tune the speed and smoothness of the animations even better.&lt;br /&gt;&lt;br /&gt;For a complete list of changes please see the change log.</content><link rel='alternate' type='text/html' href='http://www.gugga.com/flashblog/2007/05/new-minormajor-release-of-gugga-flash.html' title='The new Minor(major) release of  Gugga Flash Framework'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18955489&amp;postID=4119625084032102368' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://www.gugga.com/flashblog/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18955489/posts/default/4119625084032102368'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18955489/posts/default/4119625084032102368'/><author><name>sotirov</name></author></entry><entry><id>tag:blogger.com,1999:blog-18955489.post-116375332280556132</id><published>2006-11-17T00:48:00.000-08:00</published><updated>2006-11-22T23:01:20.966-08:00</updated><title type='text'>Anatomy of a Button in GuggaFF</title><content type='html'>The gugga.components.Button class in GuggaFF is designed to provide functionality for managing the visual states of a button and to inform for mouse events over it.&lt;br /&gt;&lt;br /&gt;Mouse events which the Button dispatches are “click”, “press”, “rollOver”, “rollOut”. On all of them it can change its appearance. In addition the button can be in one of  its selection states which also determines certain visualization.&lt;br /&gt;&lt;br /&gt;Selection states:&lt;br /&gt;&lt;li&gt;off – button is not selected&lt;br /&gt;&lt;li&gt;on – button is selected&lt;br /&gt;&lt;li&gt;offDisable –  button is disabled and is not selected&lt;br /&gt;&lt;li&gt;onDisable –  button is disabled and selected&lt;br /&gt;&lt;br /&gt;Mouse states:&lt;br /&gt;&lt;li&gt;Roll – mouse is rolled over the button&lt;br /&gt;&lt;li&gt;Down – button is pressed&lt;br /&gt;&lt;li&gt;Normal – none of the above is happening&lt;br /&gt;&lt;br /&gt;In each moment of its life a button is in one of its selection states and one of the mouse states. Selection and mouse states are combined together to represent the unified button state. Here is the table of all possible states:&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.gugga.com/GuggaFlashFramework/samples/images/button_states.jpg"&gt;&lt;img style="cursor:pointer; cursor:hand;" src="http://www.gugga.com/GuggaFlashFramework/samples/images/button_states.jpg" border="0" alt="" /&gt;&lt;/a&gt;&lt;br&gt;&lt;br /&gt;Let's take a closer look at some of the button states:&lt;br /&gt;&lt;li&gt;offRoll is when button is not selected but is rolled&lt;br /&gt;&lt;li&gt;onDisableRoll is when button is selected, disabled and rolled&lt;br /&gt;&lt;li&gt;offDisableDown, onDisableDown – the only two combinations which are impossible because when button is disabled it can’t be pressed&lt;br /&gt;&lt;br /&gt;Now if we want to transit from one state to another we can create transition. Its name is generated with this pattern: oldState_newState, for example - off_offRoll.&lt;br /&gt;&lt;br /&gt;Each button is a MovieClip with linked gugga.components.Button class to it. Button states and transitions are placed on the button’s timeline. They are marked with frame labels named as the state or transition’s name. On the end of each of these timeline segments, where the certain animation is finished, the stopPlaying() function should be called. If we want two, three or more states to be identical, we don’t need to create portions of the timeline for each of them. Despite this we could simply put several labels on the frame where the desired state or transition animation starts.&lt;br /&gt;&lt;br /&gt;There are 10 button states and because it is possible to go from each state to all others, we have 9*10=90 transitions. Do we have to create all of them? &lt;br /&gt;Of course not.&lt;br /&gt;&lt;br /&gt;The main idea in the implementation of GuggaFF Button is that we should create only those states and transitions which we need. When the button goes to another state, it first tries to play transition with name made by the pattern oldState_newState. If there is such a transition the button plays it and when it is finished the button tries to play the newState. &lt;br /&gt;If this transition does not exist then newState is played directly. &lt;br /&gt;If we have neighter transition, nor state – nothing happens.</content><link rel='alternate' type='text/html' href='http://www.gugga.com/flashblog/2006/11/anatomy-of-button-in-guggaff.html' title='Anatomy of a Button in GuggaFF'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18955489&amp;postID=116375332280556132' title='1 Comments'/><link rel='replies' type='application/atom+xml' href='http://www.gugga.com/flashblog/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18955489/posts/default/116375332280556132'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18955489/posts/default/116375332280556132'/><author><name>sotirov</name></author></entry><entry><id>tag:blogger.com,1999:blog-18955489.post-116135138656344356</id><published>2006-10-20T05:07:00.001-07:00</published><updated>2006-10-24T13:52:17.986-07:00</updated><title type='text'>Basics of Tasks and Sequences in GuggaFF</title><content type='html'>&lt;span style="font-weight:bold;"&gt;Overview&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;With this new article we would like to introduce you to one of the most important aspects of the GuggaFF, the concept of tasks and sequences and their applications. We will start with one example and how it is usually handled in Flash.&lt;br /&gt;&lt;br /&gt;Let’s examine an abstract GUI application with dynamic content implemented in Flash. One of our first tasks will be to extract the application data from our data source. It doesn't matter what of kind of data source you are using - http service, web service or simple xml file it will take a while to load and process the data. Fortunately data loading in the Flash runs in background thread, so we can implement a loading animation which will capture the user attention during these tasks. After the data is loaded we'll want to populate the controls responsible for its presentation. This example may scale to a situation where depending on the size of the data the process may need to be distributed on more than one frame to achieve the desired performance.&lt;br /&gt;&lt;br /&gt;In more complex sites we will need to implement the ability to have more then one view (also known as sections in GuggaFF) or different states of the view. Depending on user interactions we will need to switch the current section or to change its internal state. Often this operations are composition of loading and transition animations, preloading of external assets etc.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Common problems&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;During the implementation of a site in Flash we will need to handle a lot of asynchronous operations. The base approach is to register an event handler for the completion of the operation and use it to continue our work after the asynchronous task is finished. If you are using the event delegation mechanism of mx framework it would be something like this:&lt;br /&gt;&lt;pre&gt;&lt;span class="keyword"&gt;private&lt;/span&gt; &lt;span class="keyword"&gt;var&lt;/span&gt; mImageLoader : ImageLoader;&lt;br /&gt;&lt;br /&gt;&lt;span class="keyword"&gt;private&lt;/span&gt; &lt;span class="keyword"&gt;function&lt;/span&gt; loadContent(aImageUrl : &lt;span class="identifier"&gt;String&lt;/span&gt;) : &lt;span class="identifier"&gt;Void&lt;/span&gt;&lt;br /&gt;{&lt;br /&gt;mImageLoader.&lt;span class="identifier2"&gt;addEventListener&lt;/span&gt;(&lt;span class='string'&gt;"completed"&lt;/span&gt;, Delegate.create(&lt;span class="identifier"&gt;this&lt;/span&gt;, onImageLoaderCompleted));&lt;br /&gt;mImageLoader.&lt;span class="identifier2"&gt;load&lt;/span&gt;(aImageUrl);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span class="keyword"&gt;private&lt;/span&gt; &lt;span class="keyword"&gt;function&lt;/span&gt; onImageLoaderCompleted() : &lt;span class="identifier"&gt;Void&lt;/span&gt;&lt;br /&gt;{&lt;br /&gt;&lt;span class='linecomment'&gt;//do something (ex. hide loading animation or start another loader)&lt;br /&gt;&lt;/span&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Now imagine that we want to implement a functionality which is a sequence of asynchronous operations. If we scale this approach the resulting code will be:&lt;br /&gt;&lt;pre&gt;&lt;span class="keyword"&gt;private&lt;/span&gt; &lt;span class="keyword"&gt;var&lt;/span&gt; mAnimation1 : IAnimation;&lt;br /&gt;&lt;span class="keyword"&gt;private&lt;/span&gt; &lt;span class="keyword"&gt;var&lt;/span&gt; mAnimation2 : IAnimation;&lt;br /&gt;&lt;span class="keyword"&gt;private&lt;/span&gt; &lt;span class="keyword"&gt;var&lt;/span&gt; mAnimation3 : IAnimation;&lt;br /&gt;&lt;br /&gt;&lt;span class="keyword"&gt;private&lt;/span&gt; &lt;span class="keyword"&gt;function&lt;/span&gt; initUI() : &lt;span class="identifier"&gt;Void&lt;/span&gt;&lt;br /&gt;{&lt;br /&gt;mAnimation1.&lt;span class="identifier2"&gt;addEventListener&lt;/span&gt;(&lt;span class='string'&gt;"completed"&lt;/span&gt;, Delegate.create(&lt;span class="identifier"&gt;this&lt;/span&gt;, onAnimation1Completed));&lt;br /&gt;mAnimation2.&lt;span class="identifier2"&gt;addEventListener&lt;/span&gt;(&lt;span class='string'&gt;"completed"&lt;/span&gt;, Delegate.create(&lt;span class="identifier"&gt;this&lt;/span&gt;, onAnimation2Completed));&lt;br /&gt;mAnimation3.&lt;span class="identifier2"&gt;addEventListener&lt;/span&gt;(&lt;span class='string'&gt;"completed"&lt;/span&gt;, Delegate.create(&lt;span class="identifier"&gt;this&lt;/span&gt;, onAnimation3Completed));&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span class="keyword"&gt;private&lt;/span&gt; &lt;span class="keyword"&gt;function&lt;/span&gt; startAnimationsSequence() : &lt;span class="identifier"&gt;Void&lt;/span&gt;&lt;br /&gt;{&lt;br /&gt;mAnimation1.&lt;span class="identifier2"&gt;start&lt;/span&gt;();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span class="keyword"&gt;private&lt;/span&gt; &lt;span class="keyword"&gt;function&lt;/span&gt; onAnimation1Completed() : &lt;span class="identifier"&gt;Void&lt;/span&gt;&lt;br /&gt;{&lt;br /&gt;mAnimation2.&lt;span class="identifier2"&gt;start&lt;/span&gt;();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span class="keyword"&gt;private&lt;/span&gt; &lt;span class="keyword"&gt;function&lt;/span&gt; onAnimation2Completed() : &lt;span class="identifier"&gt;Void&lt;/span&gt;&lt;br /&gt;{&lt;br /&gt;mAnimation3.&lt;span class="identifier2"&gt;start&lt;/span&gt;();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span class="keyword"&gt;private&lt;/span&gt; &lt;span class="keyword"&gt;function&lt;/span&gt; onAnimation3Completed() : &lt;span class="identifier"&gt;Void&lt;/span&gt;&lt;br /&gt;{&lt;br /&gt;&lt;span class='linecomment'&gt;//do something (ex. notify for the completion of the sequence)&lt;br /&gt;&lt;/span&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Also if we need to wait for more than one event before we can execute some function one of the possible solutions is:&lt;br /&gt;&lt;pre&gt;&lt;span class="keyword"&gt;private&lt;/span&gt; &lt;span class="keyword"&gt;var&lt;/span&gt; mImageLoader1 : ImageLoader;&lt;br /&gt;&lt;span class="keyword"&gt;private&lt;/span&gt; &lt;span class="keyword"&gt;var&lt;/span&gt; mImageLoader2 : ImageLoader;&lt;br /&gt;&lt;br /&gt;&lt;span class="keyword"&gt;private&lt;/span&gt; &lt;span class="keyword"&gt;var&lt;/span&gt; mIsImageLoader1Completed : &lt;span class="identifier"&gt;Boolean&lt;/span&gt;;&lt;br /&gt;&lt;span class="keyword"&gt;private&lt;/span&gt; &lt;span class="keyword"&gt;var&lt;/span&gt; mIsImageLoader2Completed : &lt;span class="identifier"&gt;Boolean&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span class="keyword"&gt;private&lt;/span&gt; &lt;span class="keyword"&gt;function&lt;/span&gt; initUI() : &lt;span class="identifier"&gt;Void&lt;/span&gt;&lt;br /&gt;{&lt;br /&gt;mImageLoader1.&lt;span class="identifier2"&gt;addEventListener&lt;/span&gt;(&lt;span class='string'&gt;"completed"&lt;/span&gt;, Delegate.create(&lt;span class="identifier"&gt;this&lt;/span&gt;, onImageLoader1Completed));&lt;br /&gt;mImageLoader2.&lt;span class="identifier2"&gt;addEventListener&lt;/span&gt;(&lt;span class='string'&gt;"completed"&lt;/span&gt;, Delegate.create(&lt;span class="identifier"&gt;this&lt;/span&gt;, onImageLoader2Completed));&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span class="keyword"&gt;private&lt;/span&gt; &lt;span class="keyword"&gt;function&lt;/span&gt; loadConent(aUrl1 : &lt;span class="identifier"&gt;String&lt;/span&gt;, aUrl2 : &lt;span class="identifier"&gt;String&lt;/span&gt;) : &lt;span class="identifier"&gt;Void&lt;/span&gt;&lt;br /&gt;{&lt;br /&gt;mIsImageLoader1Completed = &lt;span class="identifier"&gt;false&lt;/span&gt;;&lt;br /&gt;mIsImageLoader2Completed = &lt;span class="identifier"&gt;false&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;mImageLoader1.&lt;span class="identifier2"&gt;load&lt;/span&gt;(aUrl1);&lt;br /&gt;mImageLoader2.&lt;span class="identifier2"&gt;load&lt;/span&gt;(aUrl2);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span class="keyword"&gt;private&lt;/span&gt; &lt;span class="keyword"&gt;function&lt;/span&gt; onImageLoadersCompleted() : &lt;span class="identifier"&gt;Void&lt;/span&gt;&lt;br /&gt;{&lt;br /&gt;&lt;span class='linecomment'&gt;//do something (ex. start reveal animation)&lt;br /&gt;&lt;/span&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span class="keyword"&gt;private&lt;/span&gt; &lt;span class="keyword"&gt;function&lt;/span&gt; onImageLoader1Completed() : &lt;span class="identifier"&gt;Void&lt;/span&gt;&lt;br /&gt;{&lt;br /&gt;mIsImageLoader1Completed = &lt;span class="identifier"&gt;true&lt;/span&gt;;&lt;br /&gt;&lt;span class="keyword"&gt;if&lt;/span&gt;(mIsImageLoader2Completed)&lt;br /&gt;{&lt;br /&gt;onImageLoadersCompleted();&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span class="keyword"&gt;private&lt;/span&gt; &lt;span class="keyword"&gt;function&lt;/span&gt; onImageLoader2Completed() : &lt;span class="identifier"&gt;Void&lt;/span&gt;&lt;br /&gt;{&lt;br /&gt;mIsImageLoader2Completed = &lt;span class="identifier"&gt;true&lt;/span&gt;;&lt;br /&gt;&lt;span class="keyword"&gt;if&lt;/span&gt;(mIsImageLoader1Completed)&lt;br /&gt;{&lt;br /&gt;onImageLoadersCompleted();&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;If we combine this examples and try to scale them the result will be a big amount of spread and tangled code. So we need to find a way to generalize the management of computations which are combination of asynchronous operations.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Tasks in GuggaFF&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The base unit for solving these kind of problems in GuggaFF is the task. The task is abstraction of operation which has determined begin and end. It is represented by the interface gugga.common.ITask.&lt;br /&gt;&lt;br /&gt;In GuggaFF we have a lot of implementations of this interface – ImageLoder, XMLLoader, TimelineAnimation, PropertiesTweenAnimation. Also we provide some helper tasks which simplify and reduce the resulting code in this approach – ExecuteMethodTask, ExecuteAsynchMethodTask, SingleExecutionTask.&lt;br /&gt;&lt;br /&gt;So once we have tasks we need a way for combining them. The basic composition of tasks is the linear sequence:&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.gugga.com/GuggaFlashFramework/samples/images/task.jpg"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 600px;" src="http://www.gugga.com/GuggaFlashFramework/samples/images/task.jpg" border="0" alt="" /&gt;&lt;/a&gt; &lt;br&gt;&lt;br /&gt;&lt;br /&gt;This composition can be implemented with the gugga.sequence.TaskSequence class. It uses an single-linked list for managing the task execution. As we have in the Composite design pattern TaskSequence is also task. When we start the sequence, the head of the list is stated too. Every task in the list waits for the end of his predecessor and then it is started. This iteration continues until the last task in the sequence has been completed, then the whole sequence completes.&lt;br /&gt;&lt;br /&gt;If we rewrite the previously mentioned example of sequence of animations with the TaskSequence class it will look like:&lt;br /&gt;&lt;pre&gt;&lt;span class="keyword"&gt;private&lt;/span&gt; &lt;span class="keyword"&gt;var&lt;/span&gt; mAnimation1 : IAnimation;&lt;br /&gt;&lt;span class="keyword"&gt;private&lt;/span&gt; &lt;span class="keyword"&gt;var&lt;/span&gt; mAnimation2 : IAnimation;&lt;br /&gt;&lt;span class="keyword"&gt;private&lt;/span&gt; &lt;span class="keyword"&gt;var&lt;/span&gt; mAnimation3 : IAnimation;&lt;br /&gt;&lt;br /&gt;&lt;span class="keyword"&gt;private&lt;/span&gt; &lt;span class="keyword"&gt;function&lt;/span&gt; startAnimationsSequence() : &lt;span class="identifier"&gt;Void&lt;/span&gt;&lt;br /&gt;{&lt;br /&gt;&lt;span class="keyword"&gt;var&lt;/span&gt; animationSequence : TaskSequence = &lt;span class="keyword"&gt;new&lt;/span&gt; TaskSequence();&lt;br /&gt;animationSequence.addTask(mAnimation1);&lt;br /&gt;animationSequence.addTask(mAnimation2);&lt;br /&gt;animationSequence.addTask(mAnimation3);&lt;br /&gt;&lt;br /&gt;Listener.createSingleTimeListener(&lt;br /&gt;&lt;span class="keyword"&gt;new&lt;/span&gt; EventDescriptor(animationSequence, &lt;span class='string'&gt;"completed"&lt;/span&gt;), Delegate.create(&lt;span class="identifier"&gt;this&lt;/span&gt;, onAnimationSequenceCompleted));&lt;br /&gt;&lt;br /&gt;animationSequence.&lt;span class="identifier2"&gt;start&lt;/span&gt;();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span class="keyword"&gt;private&lt;/span&gt; &lt;span class="keyword"&gt;function&lt;/span&gt; onAnimationSequenceCompleted() : &lt;span class="identifier"&gt;Void&lt;/span&gt;&lt;br /&gt;{&lt;br /&gt;&lt;span class='linecomment'&gt;//do something (ex. notify for the completion of the sequence)&lt;br /&gt;&lt;/span&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Before describing the other composite task in GuggaFF – gugga.sequence.TaskManager we will need to introduce the abstraction for precondition.&lt;br /&gt;&lt;br /&gt;In GuggaFF it is abstracted by the gugga.common.EventDescriptor class. This class is a pair of event name and an object which raises this event. So the EventDescriptor class exactly describes a moment in the lifetime of concrete object.&lt;br /&gt;&lt;br /&gt;GuggaFF provides a mechanism for composing preconditions with the gugga.sequence.PreconditionsManager class. This manager observes a collection of preconditions and raises an event when all of them are met.&lt;br /&gt;&lt;br /&gt;If we use PreconditionsManger in the example of waiting for completion of two loaders it will be something like:&lt;br /&gt;&lt;pre&gt;&lt;span class="keyword"&gt;private&lt;/span&gt; &lt;span class="keyword"&gt;var&lt;/span&gt; mImageLoader1 : ImageLoader;&lt;br /&gt;&lt;span class="keyword"&gt;private&lt;/span&gt; &lt;span class="keyword"&gt;var&lt;/span&gt; mImageLoader2 : ImageLoader;&lt;br /&gt;&lt;br /&gt;&lt;span class="keyword"&gt;private&lt;/span&gt; &lt;span class="keyword"&gt;function&lt;/span&gt; setConent(aUrl1 : &lt;span class="identifier"&gt;String&lt;/span&gt;, aUrl2 : &lt;span class="identifier"&gt;String&lt;/span&gt;) : &lt;span class="identifier"&gt;Void&lt;/span&gt;&lt;br /&gt;{&lt;br /&gt;&lt;span class="keyword"&gt;var&lt;/span&gt; preconditionManager : PreconditionsManager = &lt;span class="keyword"&gt;new&lt;/span&gt; PreconditionsManager();&lt;br /&gt;preconditionManager.&lt;span class="keyword"&gt;add&lt;/span&gt;(&lt;span class="keyword"&gt;new&lt;/span&gt; EventDescriptor(mImageLoader1, &lt;span class='string'&gt;"completed"&lt;/span&gt;));&lt;br /&gt;preconditionManager.&lt;span class="keyword"&gt;add&lt;/span&gt;(&lt;span class="keyword"&gt;new&lt;/span&gt; EventDescriptor(mImageLoader2, &lt;span class='string'&gt;"completed"&lt;/span&gt;));&lt;br /&gt;&lt;br /&gt;Listener.createSingleTimeListener(&lt;br /&gt;&lt;span class="keyword"&gt;new&lt;/span&gt; EventDescriptor(preconditionManager, &lt;span class='string'&gt;"preconditionsMet"&lt;/span&gt;), Delegate.create(&lt;span class="identifier"&gt;this&lt;/span&gt;, onImageLoadersCompleted));&lt;br /&gt;&lt;br /&gt;mImageLoader1.&lt;span class="identifier2"&gt;load&lt;/span&gt;(aUrl1);&lt;br /&gt;mImageLoader2.&lt;span class="identifier2"&gt;load&lt;/span&gt;(aUrl2);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span class="keyword"&gt;private&lt;/span&gt; &lt;span class="keyword"&gt;function&lt;/span&gt; onImageLoadersCompleted() : &lt;span class="identifier"&gt;Void&lt;/span&gt;&lt;br /&gt;{&lt;br /&gt;&lt;span class='linecomment'&gt;//do something (ex. start reveal animation)&lt;br /&gt;&lt;/span&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;When we have the idea for precondition, we can easily describe the TaskManager class as a composite task which manages the execution of its children by preconditions. We can think that the TaskManager is a web of tasks connected by preconditions.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.gugga.com/GuggaFlashFramework/samples/images/task1.jpg"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 600px;" src="http://www.gugga.com/GuggaFlashFramework/samples/images/task1.jpg" border="0" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;According to Composite Pattern, the TaskManager is task itself. When the manager is started, all of its starting tasks are started too. When all the preconditions for certain task in the web are met and all of his predecessors are completed then the task is started. The manager is completed when all final tasks are completed and all final precondition are met.&lt;br /&gt;&lt;br /&gt;As you see TaskManager lets you to solve complex situations which are combination of all previously mentioned common problems. A simple example of his usage can be illustrated by extending the example for usage of PreconditionManager by adding an animation which should be started after completion of the loaders. So the resulting code will be:&lt;br /&gt;&lt;pre&gt;&lt;span class="keyword"&gt;private&lt;/span&gt; &lt;span class="keyword"&gt;var&lt;/span&gt; mImageLoader1 : ImageLoader;&lt;br /&gt;&lt;span class="keyword"&gt;private&lt;/span&gt; &lt;span class="keyword"&gt;var&lt;/span&gt; mImageLoader2 : ImageLoader;&lt;br /&gt;&lt;span class="keyword"&gt;private&lt;/span&gt; &lt;span class="keyword"&gt;var&lt;/span&gt; mAnimation : IAnimation;&lt;br /&gt;&lt;br /&gt;&lt;span class="keyword"&gt;private&lt;/span&gt; &lt;span class="keyword"&gt;function&lt;/span&gt; setContent(aUrl1 : &lt;span class="identifier"&gt;String&lt;/span&gt;, aUrl2 : &lt;span class="identifier"&gt;String&lt;/span&gt;) : &lt;span class="identifier"&gt;Void&lt;/span&gt;&lt;br /&gt;{&lt;br /&gt;&lt;span class="keyword"&gt;var&lt;/span&gt; taskManager : TaskManager = &lt;span class="keyword"&gt;new&lt;/span&gt; TaskManager();&lt;br /&gt;taskManager.addStartingTasks([mImageLoader1, mImageLoader2]);&lt;br /&gt;taskManager.addTaskWithPredecessors(mAnimation, [mImageLoader1, mImageLoader2]);&lt;br /&gt;taskManager.setFinalTask(mAnimation);&lt;br /&gt;&lt;br /&gt;Listener.createSingleTimeListener(&lt;br /&gt;&lt;span class="keyword"&gt;new&lt;/span&gt; EventDescriptor(taskManager, &lt;span class='string'&gt;"completed"&lt;/span&gt;), Delegate.create(&lt;span class="identifier"&gt;this&lt;/span&gt;, onTaskManagerCompleted));&lt;br /&gt;&lt;br /&gt;taskManager.&lt;span class="identifier2"&gt;start&lt;/span&gt;();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span class="keyword"&gt;private&lt;/span&gt; &lt;span class="keyword"&gt;function&lt;/span&gt; onTaskManagerCompleted() : &lt;span class="identifier"&gt;Void&lt;/span&gt;&lt;br /&gt;{&lt;br /&gt;&lt;span class='linecomment'&gt;//do something (ex. notify for the completion)&lt;br /&gt;&lt;/span&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Stay tuned for more articles related to interruption of tasks, deeper look into web of tasks (TaskManager) and more advanced techniques related to their usage.</content><link rel='alternate' type='text/html' href='http://www.gugga.com/flashblog/2006/10/basics-of-tasks-and-sequences-in_20.html' title='Basics of Tasks and Sequences in GuggaFF'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18955489&amp;postID=116135138656344356' title='6 Comments'/><link rel='replies' type='application/atom+xml' href='http://www.gugga.com/flashblog/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18955489/posts/default/116135138656344356'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18955489/posts/default/116135138656344356'/><author><name>sotirov</name></author></entry><entry><id>tag:blogger.com,1999:blog-18955489.post-115936567145643164</id><published>2006-09-27T06:30:00.000-07:00</published><updated>2007-01-03T09:58:22.720-08:00</updated><title type='text'>Application Building Blocks part 2 - Commands</title><content type='html'>&lt;span style="FONT-WEIGHT: bold"&gt;Leveraging the browser back and forward functionality in Flash using Commands and the Gugga Flash Framework&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;With this new posting we would like to introduce one more of the key aspects used in the Gugga Flash Framework, the Commands, along with a real world example how to apply them. As a wide aspect framework GUGGAFF takes advantage of this well known concept in software development to introduce some key features. Commands' sole purpose is to abstract requests and encapsulate their logic. They decouple the caller from the callee, allowing undoable actions and preprocessing.&lt;br /&gt;We will show you how you can apply that to manage the browser history functionality in a Flash application, or in more familiar terms the browser back and forward buttons. Although there are already examples of such implementations most of what we seen is for applications build using frame based approach. But what happens when you do not have frames and you want to build a flash application using OO methodology? The need to persist application state, ability to buffer what the user does with your application and restore that state.&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold"&gt;&lt;br /&gt;Command Pattern&lt;/span&gt;&lt;br /&gt;We are not going to lay out in detail what the command pattern is all about but for the sake of context and explanations how we applied it in GuggaFF here is a brief layout:&lt;br /&gt;„Sometimes it's necessary to issue requests to objects without knowing anything about the operation being requested or the receiver of the request....&lt;br /&gt;The Command pattern lets objects make requests of unspecified application objects by turning the request itself into an object. This object can be stored and passed around like other objects. The key to this pattern is an abstract Command class, which declares an interface for executing operations. In the simplest form this interface includes an abstract Execute operation. Concrete Command subclasses specify a receiver-action pair by storing the receiver as an instance variable and by implementing Execute to invoke the request. The receiver has the knowledge required to carry out the request...“&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.gugga.com/GuggaFlashFramework/samples/images/command_patern01.jpg"&gt;&lt;img style="CURSOR: hand; WIDTH: 500px;" alt="" src="http://www.gugga.com/GuggaFlashFramework/samples/images/command_patern01.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold"&gt;GuggaFF and Commands&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In GUGGAFF the Commands primary usage is to abstract navigational requests. A navigation request might imply a various expected results: opening or closing a secton, a popup, following a deep link or cross section navigation, position a component in a state.&lt;br /&gt;When you build an application with GUGGAFF, you can base the navigation architecture of your application on commands for navigating through the Sections or inside components.&lt;br /&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold"&gt;The Benefits&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;Using commands allows us to abstract the invoker of a navigation requests from the receiver.&lt;br /&gt;&lt;li&gt;We are also able to maintain a command history buffer , which helps us to support browser history events such as back and forward.&lt;br /&gt;&lt;br /&gt;Key Players and their responsibilities&lt;br /&gt;&lt;br /&gt;There are several key players in the framework that cooperate using commands.&lt;br /&gt;&lt;br /&gt;&lt;li&gt;MenuItemsController, responsible for execution of NavigationCommands in response to user activities with your application's navigation menu. It is the invoker from the diagram above.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;NavigationCommand, a specific command implementation possesing enough information to navigate through the application.&lt;br /&gt;&lt;li&gt;OpenPopupCommand, another implementation of command used for opening popup within your application&lt;/li&gt;&lt;br /&gt;&lt;li&gt;CommandManager , a singleton responsible for executing commands without being aware of their specific implementations since they expose the command interface. It also acts as a history buffer, but we will get to that later.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Application, a command receiver for NavigationCommands, available through the IApplicationCommandReceiver interface.&lt;/li&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold"&gt;&lt;br /&gt;How does it all work?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;We have already made a brief lay out of the command pattern and also identified the key players participating. Here is a more detailed explanation about the players in the GuggaFF and how they cooperate.&lt;br /&gt;&lt;br /&gt;The Application class was identified as the command receiver for navigation requests, and it should provide the IApplicationCommandReceiver interface to the commands. The interface defines methods for:&lt;br /&gt;&lt;br /&gt;1. Navigating inside the application using a given Section Path (a dot notation of sections or components hierarchy describing it uniquely)&lt;br /&gt;We would expect the commands in our history buffer to be able to reverse the application state. Considering that the application also exposes the following methods :&lt;br /&gt;&lt;br /&gt;2.Creating navigation state (Memento Desing pattern) preserving the current navigation Path.&lt;br /&gt;&lt;br /&gt;3.Setting navigation state to a previously preserved one&lt;br /&gt;&lt;br /&gt;A MenuItemsController in our application acts as an invoker for commands. To ensure the invokation, we equipe the controller with commands for the items it aggregates. It is usually done durring the initialization of the controller.&lt;br /&gt;&lt;br /&gt;To maintain a history buffer, the MenuItemsController delegates the command execution to the CommandManager singletone. Once the execution is delegated to him, the command is stored in the buffer and processed.&lt;br /&gt;The CommandManager also needs to be able to reverse the application state. Reversing of the application state is available calling the manager, to navigate to a particular command in its buffer. To identify the command in the buffer we use a command index. A command index should be remembered whenever we want to be able to reverse to a state.&lt;br /&gt;&lt;br /&gt;This ability to reverse state forces the commands to create and store a navigation state memento right before their execution.&lt;br /&gt;&lt;br /&gt;The next aspect is how the command pattern implemented within the framework gives us the ability to manage the browser history back and forward.&lt;br /&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold"&gt;Real world example of managing browser history back and forward&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Solution architecture&lt;br /&gt;&lt;br /&gt;The first issue we face when building a solution to manage browser back and forward buttons is the fact that the browser history buffer is not affected when the flash application is navigated. A way to solve this problem, is to issue parallel requests to the browser, every time the application is navigated, and it is also an important point that these requests should not cause reload of the flash movie. To do that, we choose to update the hash of the browser address bar.&lt;br /&gt;&lt;br /&gt;Once we are able to use the browser buttons, we would expect them to reverse the application to a previous navigational state. In order to do that, our application is forced to maintain its own history buffer for navigational states.&lt;br /&gt;It should meet the following requirements&lt;br /&gt;&lt;br /&gt;1.Navigational requests should be abstracted so the history buffer can work with them&lt;br /&gt;2.The history buffer should be able to reverse the application state using the stored requests&lt;br /&gt;&lt;br /&gt;To meet the requirements we abstract navigational requests into commands and store them into the history buffer. The commands also might be undone or re-executed later to reverse the application state.&lt;br /&gt;&lt;br /&gt;Once we have the commands we should put them together with the items in the browser history, which we do by passing a command identifier to the address bar hash. Given that we are able to reverse the application navigational state when the browser history is navigated.&lt;br /&gt;&lt;br /&gt;In addition to the previously mentioned key players we also:&lt;br /&gt;&lt;br /&gt;1.Need a class abstracting the communication with the address bar. This is the AddressBar.&lt;br /&gt;2.And a class maintaining the communication between the AddressBar and the CommandManager. This is the AddressBarManager.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The following sequence diagram illustrates the interactions between the participants in our solution.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.gugga.com/GuggaFlashFramework/samples/images/commands_history.jpg"&gt;&lt;img style="WIDTH: 500px; CURSOR: hand" alt="" src="http://www.gugga.com/GuggaFlashFramework/samples/images/commands_history.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;[DOWNLOAD]&lt;br /&gt;&lt;br /&gt;You can test the application here:&lt;br /&gt;&lt;a href="http://www.gugga.com/GuggaFlashFramework/samples/HistoryManagementDeepLinks/" target="_blank"&gt;History Management Sample App&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;You can download the sample application from here:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.gugga.com/GuggaFlashFramework/samples/HistoryManagementDeepLinks/HistoryManagement.zip" target="_blank"&gt;HistoryManagement.zip&lt;/a&gt;</content><link rel='alternate' type='text/html' href='http://www.gugga.com/flashblog/2006/09/application-building-blocks-part-2.html' title='Application Building Blocks part 2 - Commands'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18955489&amp;postID=115936567145643164' title='10 Comments'/><link rel='replies' type='application/atom+xml' href='http://www.gugga.com/flashblog/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18955489/posts/default/115936567145643164'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18955489/posts/default/115936567145643164'/><author><name>sotirov</name></author></entry><entry><id>tag:blogger.com,1999:blog-18955489.post-115859215856296734</id><published>2006-09-20T08:08:00.000-07:00</published><updated>2006-11-09T05:11:07.216-08:00</updated><title type='text'>Why a new Flash Framework?</title><content type='html'>Flash as a technology besides its obvious benefits and capabilities posses greater then other technologies challenges related to work flow , separation of code and design , development environment, process, maintenance, extensibility and reusability of concepts and code.&lt;br /&gt;Most of the developers working with flash and creating web sites do not use OO programming and design patterns.90% of them are single developers not teams and they consider this an overhead. The methodology and approach used in other technologies are not applied in Flash only in Flex and other frameworks that are build around creating applications not web sites in Flash.&lt;br /&gt;Let's look at the available options for building OO, extensible , maintainable flash based web sites. There are a number of frameworks most of which focus on applications(Flex, Cairngorn, ARP). At the same time most of the web sites build using Flash are multi page web sites. Someone can argue that application frameworks can be used to build sites but in fact the requirements are so different that this is yet to be proved that is has an economic value to it.&lt;br /&gt;Let's add to this mixture one more critical element, the creative one.Each web site strived to be very unique in terms of look, feel and interactions.&lt;br /&gt; &lt;br /&gt;So a flash developer/team is under gun to create a unique look and feel, very highly interactive, performing, web site under tight deadline. Add to that you want to be able to reuse your code, concepts, architecture. Implement the site in a way that a year from now you can still read and extend your code and the requirements just hit the sealing. If this is not enough, you as a developer do not have the proper development environment, debugging and testing tools and frameworks.Or is it so ...Off course we will not address all these issues in one article but we will start taking care of those one by one.&lt;br /&gt; &lt;br /&gt;We are not going to list all problems related to developing web sites with Flash but to quote Jesse Warden from one of his posts there are 4 key problem with Flash Development:&lt;br /&gt;# Deadline - all projects are under tight dealdline which imposes requirements for how quickly can you pull a project&lt;br /&gt;# Creative - you cannot pose any creative restrictions upfront to the designers and IA&lt;br /&gt;# Bandwidth - you must employee as little as possible resources&lt;br /&gt;# Maintainability - you have to be able to extend every web site you have ever build no matter how much time it went by and make it quick&lt;br /&gt;&lt;br /&gt;Let's add to that list a bit more spice and what we want to be able to do with Flash from a Software Development Perspective:&lt;br /&gt;# write in OO manner in Flash&lt;br /&gt;# use Design Patterns in Flash&lt;br /&gt;# create maintainable, extensible data aware multi tier web sites in Flash&lt;br /&gt;&lt;br /&gt;I believe we owe you one more definition and an explanation, why do we think we have a framework and the best explanation we found is in one of the famous Design Paterns Books:&lt;br /&gt;"A framework is a set of cooperating classes that make up a reusable design for a specific class of software... You customize a framework to a particular application by creating application-specific subclasses of abstract classes from the framework.&lt;br /&gt;&lt;br /&gt;The framework dictates the architecture of your application. It will define the overall structure, its partitioning into classes and objects, the key responsibilities thereof, how the classes and objects collaborate, and the thread of control. A framework predefines these design parameters so that you, the application designer/implementer, can concentrate on the specifics of your application. The framework captures the design decisions that are common to its application domain. Frameworks thus emphasize design reuse over code reuse, though a framework will usually include concrete subclasses you can put to work immediately...&lt;br /&gt;&lt;br /&gt;Not only can you build applications faster as a result, but the applications have similar structures. They are easier to maintain, and they seem more consistent to their users. On the other hand, you lose some creative freedom, since many design decisions have been made for you...&lt;br /&gt;&lt;br /&gt;Frameworks are becoming increasingly common and important. They are the way that object-oriented systems achieve the most reuse. Larger object-oriented applications will end up consisting of layers of frameworks that cooperate with each other. Most of the design and code in the application will come from or be influenced by the frameworks it uses."&lt;br /&gt;&lt;br /&gt;We could not put it better not only in terms of what we are expecting of a framework but what we actually are offering and we can only encourage you to explore Gugga Flash Framework. I'm sure it has room to be extended and improved but we believe there is a very good foundation proved to work in a large number of real work projects.</content><link rel='alternate' type='text/html' href='http://www.gugga.com/flashblog/2006/09/why-new-flash-framework.html' title='Why a new Flash Framework?'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18955489&amp;postID=115859215856296734' title='7 Comments'/><link rel='replies' type='application/atom+xml' href='http://www.gugga.com/flashblog/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18955489/posts/default/115859215856296734'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18955489/posts/default/115859215856296734'/><author><name>sotirov</name></author></entry><entry><id>tag:blogger.com,1999:blog-18955489.post-115857641151617185</id><published>2006-09-18T03:45:00.000-07:00</published><updated>2006-09-19T02:58:48.286-07:00</updated><title type='text'>Application Building Blocks part 1 - Sections</title><content type='html'>The Sections are the base logical and application building blocks in an application based on the GUGGAFF. Sections implementation follows the Page Controller design pattern. Each section is responsible for displaying and controlling one logical part of the application. The scope and content of this part can be defined depending of the needs in every single application. Each section should follow the rule for logical encapsulation, and should have a consistent lifecycle.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Sections Lifecycle&lt;/b&gt; &lt;br /&gt;The lifecycle of a Section is comprised of five sequences – Initialization, Activation, Opening, Closing and Destroying. They are actually referenced as Tasks but thanks to the Composite pattern used, we can have complex sequences at this places. Each of those Sequences will be executed when that cycle step is due.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Initialization&lt;/b&gt;&lt;br /&gt;Section initialization sequence is triggered when the section is instantiated and should initialize itself to become fit for work. This can include components creation, essential data loading and other tasks that ensure the workability of the section. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;Activation&lt;/b&gt;&lt;br /&gt;Activation sequence is triggered in the very first moments when the section is about to be opened. The opening of a section is triggered only when the closing sequence of the previous section is complete. This way the Activation sequence starts with the previous section’s Closing sequence. During the Activation sequence the section can prepare itself for the upcoming Opening sequence. It can for example perform lazy loading by loading its data here but not in the initialization sequence. &lt;br /&gt;In a common scenario the Initialization and Activation sequences are time consuming tasks. They must also complete prior to the Opening of the section and we have to entertain the end user during that time period. That’s why each section provides its controller a way to monitor the progress of the tasks which precede the Opening. These tasks are not coupled with the initialization and activation sequence sequences. They can contain subparts of them, but its programmer’s choice what to put in the pre open progress monitor. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;Opening and Closing &lt;/b&gt;&lt;br /&gt;One of the key aspects that is used in every web site is the ability of the sections to open and close. Those sequences common use is to play animations. Closing tasks can also be used for freeing some temporary allocated resources.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Destroying&lt;/b&gt;&lt;br /&gt;The destroying sequence of the lifecycle is not as common scenario. Its usage appears when dealing with sections that feature large amounts of content in them which should be destroyed to free the flash player resources.&lt;br /&gt;The common functionality for controlling the section’s lifecycle is implemented in the gugga.application.Section class. All the sections in a GUGGAFF application should extend this class. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;Nesting Sections&lt;/b&gt;&lt;br /&gt;Sections can be nested. They follow the Composite design pattern to implement this functionality. A group of nested sections is controlled by a Sections Controller (gugga.application.SectionsController), which is a Section it self. In addition the Sections controller is responsible for switching between its child sections which must be registered with him. &lt;br /&gt;&lt;li&gt;There are three types of sections that can be registered with a Sections Controller. Sections that are already instantiated on the scene and you can reference their instance names.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Lazy attach sections which exist in the library, but are still not instantiated.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Sections that will be loaded as external Swf files.&lt;/li&gt;&lt;br /&gt;&lt;b&gt;Navigating between Sections&lt;/b&gt;&lt;br /&gt;When a command is issued to navigate from one Section to another, the Section Controller instantiates a Sections Transition (gugga.application.SectionTransition) object which handles the transition. This object does all the work to ensure the correct lifecycle of the sections involved in the transition.</content><link rel='alternate' type='text/html' href='http://www.gugga.com/flashblog/2006/09/application-building-blocks-part-1.html' title='Application Building Blocks part 1 - Sections'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18955489&amp;postID=115857641151617185' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://www.gugga.com/flashblog/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18955489/posts/default/115857641151617185'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18955489/posts/default/115857641151617185'/><author><name>sotirov</name></author></entry><entry><id>tag:blogger.com,1999:blog-18955489.post-115856959921577915</id><published>2006-09-18T01:52:00.000-07:00</published><updated>2006-09-18T01:53:19.230-07:00</updated><title type='text'>Key Concepts in Gugga Flash Framework?</title><content type='html'>This is the first of a series of articles that will introduce the key concepts in the Gugga Flash Framework. The idea behind those articles is trivial to easy the process of Introducing developers to the framework. Before we dive in the key concepts we owe you a little more insite and something as a definition of what the framework is.&lt;br /&gt;The Gugga Flash Framework is a library of application building blocks designed to assist developers with common development challenges.&lt;br /&gt;&lt;br /&gt;Application blocks are set of classes that can be asociated to movie clips and used "as is", extended, or modified by developers to use in Rich Internet Applications (RIA) projects. They are designed to encapsulate the best practices for Flash and enterprice applications, help address the common problems that developers face from one project to the next, and also addresses scenarios not directly supported by the underlying class libraries supplied by Macromedia.&lt;br /&gt;&lt;br /&gt;The GuggaFF focus in Rich Internet Applications determine that main concepts in the framework are those of the Section, Application and Task and Sequence. To create an application using the GuggaFF you mush have at least :&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Section&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;The Section is the main application building block. If nothing else a single section will exist and this will be the Application. The name Section was chosen because the abstraction Section is a common knowledge for everyone who was ever involved in creating a web site. The Section abstraction also implies:&lt;br /&gt;&lt;br /&gt;    * one can navigate from and to a Section&lt;br /&gt;    * that it is a container assuming responsibility for a certain level of encapsulated functionality or information. &lt;br /&gt;&lt;br /&gt;From a development perspective, in GuggaFF, the Section is a class. This class or its successor must be assigned to a Movie clip in a FLA file to allow its participation in an Application.&lt;br /&gt;&lt;br /&gt;From a Designer perspective the Contents of the movie clip associated with the Section class can be edited using Macromedia Flash editor to add graphic symbols or other components.&lt;br /&gt;&lt;br /&gt;This architectural approach follows our firm belief that we have to allow for separation of design from development work.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Section Controller&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Besides Section we have one more very important player and this is the SectionController. SectionController is a kind of Section that contains other sections. If a Section must contain other Sections then it have to become a SectionController?. It acts like an Application for its own contained sections. Actualy the Application it self is an extension of a SectionController. This approach allows for unlimited level of nesting of sections without sacrifising flexibibility and ease of use.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Application&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;In GuggaFF the Application follows the MVC pattern, and acts as a “controller” that assumes responsibility to respond to navigation events, register and manage its contained sections. The Application responsibilities are not limited to control the Sections but are extended to :&lt;br /&gt;&lt;br /&gt;    * configure the entire application,&lt;br /&gt;    * preload globally used resources&lt;br /&gt;    * prepare data connectors&lt;br /&gt;    * other system wide tasks. &lt;br /&gt;&lt;br /&gt;The Application is also associated with a Movie Clip&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Task&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Task represents small piece of work that has to be executed, or a function to be performed in order to constitute a complete unit of action. Tasks can be linked together in order to achieve desired result.&lt;br /&gt;&lt;br /&gt;Code execution in Flash is always synchronous. All code that belongs to a frame must be executed before player moves to another frame. At the same time, many critical aspects in application development have an asynchronous nature. This includes but is not limited to:&lt;br /&gt;&lt;br /&gt;    * loading of external resources&lt;br /&gt;    * access to data and it’s processing&lt;br /&gt;    * waiting for user interaction&lt;br /&gt;    * initialization of components&lt;br /&gt;    * and so on. &lt;br /&gt;&lt;br /&gt;Some of these actions cannot not even start before the playhead has moved to the next /sometimes virtual/ frame. This is real reason behind introducing the concept of the Task, to handle such situations.&lt;br /&gt;&lt;br /&gt;Task are building blocks that can be either used alone or included into the Sequences. They :&lt;br /&gt;&lt;br /&gt;    * defines its own start and completion&lt;br /&gt;    * can either have synchronous or asynchronous nature&lt;br /&gt;    * can be externally manageable - their start can be invoked by someone when certain conditions are met.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Sequence&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Sequences are used to organize task execution and synchronization. They are a representation of a workflow that must be executed in order to complete a complex process. Sequences can be linear or graph.&lt;br /&gt;&lt;br /&gt;Linear sequences are intended to be sequential and to start next task, only when the previous one have completed. They are very easy to construct and can handle a web of situations.&lt;br /&gt;&lt;br /&gt;In more complex situations a graph like Sequence /represented by class TaskManager? / can be used. In such cases the task execution time can depend on the completion of more than one Predecessor Task, or even External Preconditions. Task completion itself can trigger execution of more than one task. Multiple starting tasks and complex “complete” status determination are also possible to implement.&lt;br /&gt;&lt;br /&gt;Sequences are also considered Tasks. You can include one sequence into another just like adding any other atomic task. Armed with that flexibility there are no restrictions to what you can acheive.&lt;br /&gt;&lt;br /&gt;Sections and Application use sequences to perform their duties. For example a Section is intended to have 4 different sequences&lt;br /&gt;&lt;br /&gt;    * Initialization – executed only once and it prepares a section for work&lt;br /&gt;    * Activation – executed every time a section is nominated to be opened . This sequence is executed concurrently with the Closing Sequence of the Section being closed. It starts its execution when the Closing Sequence of the previously opened Section is started. This Sequence is intended to load external resources or reorganize the Section content&lt;br /&gt;    * Open - Opening Sequence is intended to reveal the currently selected Section. It starts its execution when Closing Sequence of previous section is completed.&lt;br /&gt;    * Close – executed when section is closed &lt;br /&gt;&lt;br /&gt;The next set of articles will dive into greater detail as to how those key aspects interact or work</content><link rel='alternate' type='text/html' href='http://www.gugga.com/flashblog/2006/09/key-concepts-in-gugga-flash-framework.html' title='Key Concepts in Gugga Flash Framework?'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18955489&amp;postID=115856959921577915' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://www.gugga.com/flashblog/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18955489/posts/default/115856959921577915'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18955489/posts/default/115856959921577915'/><author><name>sotirov</name></author></entry><entry><id>tag:blogger.com,1999:blog-18955489.post-115704108376659863</id><published>2006-08-31T02:46:00.000-07:00</published><updated>2006-09-19T03:42:06.453-07:00</updated><title type='text'>Gugga Flash Framework first release</title><content type='html'>Nine months later and hopefully alot wiser the first official release of the framework is here. The reason for the delay is obvious, we wanted to share what we think is best at this point of time. Is it complete? Far from it. But is it good enough to be released in the public domain, you can count on that.&lt;br /&gt;Every significant project we have build is based on that framework and we have not made a step back of the principles we said we will defend.&lt;br /&gt;Ok, no more of as one friend nicely put it, programmer bravado.&lt;br /&gt;&lt;br /&gt;You can download the framework from here:&lt;br /&gt;&lt;a href="http://www.gugga.com/GuggaFlashFramework/" target="_blank"&gt;Gugga Flash Framework 0.9&lt;/a&gt;&lt;br /&gt;You can review the documentation for the framework here:&lt;br /&gt;&lt;a href="http://www.gugga.com/GuggaFlashFramework/documentation/html/" target="_blank"&gt;Gugga Flash Framework Documentation in HTML format&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The package contains not just the framework but also the unit testing framework for it and some sample applications to get you started.&lt;br /&gt;The unit testing framework is for those of you who would decide to extend it and want to make sure your code does not brake anything.&lt;br /&gt;We are working on releasing a wiki that will feature some articles about how to use the framework and we will be happy to hear from you.&lt;br /&gt;We do hope you will find interesting and engaging in what we do and for everyone interested to contribute to do so. Because after all this is the idea to grow from where we are now and to create something that everyone involved in developing rich interactive web sites using Flash technologies and OOP.&lt;br /&gt;&lt;br /&gt;Some of the more significant web sites that have been build based on the framework:&lt;br /&gt;&lt;a href="http://www.bombaysapphire.com/" target="_blank"&gt;Bombay Sapphire&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.dewarswow.com/" target="_blank"&gt;Dewars World of Whiskey&lt;/a&gt;  &lt;br /&gt;&lt;a href="http://bar.tv/" target="_blank"&gt;Bar TV&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Acknowledgements To Everyone's Code And Concepts We Based Our Framework On.&lt;br /&gt;&lt;a href="http://www.macromedia.com" target="_blank"&gt;Macromedia&lt;/a&gt; &lt;br /&gt;Thank You First and foremost for creating Flash :)&lt;br /&gt;&lt;br /&gt;We are using some concepts,classes and implementations of their UI component Framework, Web Service Connector, Delegate Utils.&lt;br /&gt;&lt;a href="http://as2lib.org/" target="_blank"&gt;AS2LIB&lt;/a&gt; &lt;br /&gt;Thank you for the Unit testing capabilities, reflection and Hash Map collection&lt;br /&gt;&lt;a href="http://code.audiofarm.de/Logger/" target="_blank"&gt;as2logger&lt;/a&gt;&lt;br /&gt;Thank you for the logging capabilities&lt;br /&gt;&lt;a href="http://robertpenner.com/"  target="_blank"&gt;Robert Penner&lt;/a&gt; &lt;br /&gt;Thank you for your easing animations&lt;br /&gt;&lt;a href="http://moock.org"  target="_blank"&gt;Colin Moock&lt;/a&gt; &lt;br /&gt;Thank you for your application template idea and first steps in applying design patterns in Flash&lt;br /&gt;&lt;a href="http://www.darronschall.com/weblog/"  target="_blank"&gt;Darron Schall&lt;/a&gt;&lt;br /&gt;Thank you for your Date Format Class&lt;br /&gt;&lt;a href="http://www.meychi.com"  target="_blank"&gt;Mika Palmu&lt;/a&gt;&lt;br /&gt;Thank you for the Crypthology capabilities&lt;br /&gt;&lt;a href="http://laco.wz.cz/tween/"  target="_blank"&gt;Ladislav Zigo&lt;/a&gt;&lt;br /&gt;Thank you for the Tweening Classes&lt;br /&gt;&lt;a href="http://www.sephiroth.it/"&gt;Alessandro Crugnola&lt;/a&gt;&lt;br /&gt;Thank you for your XML2Object</content><link rel='alternate' type='text/html' href='http://www.gugga.com/flashblog/2006/08/gugga-flash-framework-first-release.html' title='Gugga Flash Framework first release'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18955489&amp;postID=115704108376659863' title='1 Comments'/><link rel='replies' type='application/atom+xml' href='http://www.gugga.com/flashblog/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18955489/posts/default/115704108376659863'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18955489/posts/default/115704108376659863'/><author><name>sotirov</name></author></entry><entry><id>tag:blogger.com,1999:blog-18955489.post-113198502124791315</id><published>2005-11-14T07:20:00.000-08:00</published><updated>2006-11-09T11:21:12.576-08:00</updated><title type='text'>Purpose and Scope of this blog</title><content type='html'>With this initial posting we would like to announce to the ever growing Flash development community our ongoing efforts to create and maintain an extensible Macromedia Flash based framework for developing highly engaging and interactive web sites using sound Object Oriented methodology and approach.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;We believe&lt;/span&gt; ...&lt;br /&gt;That the development of any interactive content should not be made at the expense of good software design. We are committed to allow the design community to continuosly express their creative efforts in the best possible way and at the same time to enable the developers to create a well designed, performant, executable, tested and maintainable software. We would also like to chalenge you and see what your thinking in this direction is.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Based on our experience&lt;/span&gt; ...&lt;br /&gt;We believe we can share our success and failure and introduce a different and hopefully successful approach how to develop interactive content using Macromedia Flash.&lt;br /&gt;&lt;br /&gt;This framework is based on 2 years of our collective effort and over a 100 projects and in its latest incarnation will attempt to introduce what we believe is a sound and extensible way of approaching development of Flash modules.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Why share?&lt;/span&gt;&lt;br /&gt;Well, a lot of what we do and the reason for some of our success is because the flash community has always been open to sharing. You will witness that we reference and use a lot of open code and we base some of our solutions on it.&lt;br /&gt;We strongly believe there is a point when one has to share his work and expose it to the thoughts and candor of the flash community and the people engaged in the flash development.&lt;br /&gt;We would like to pick your brains and we are confident that we will spawn your interest once you take the time to see what we have done.&lt;br /&gt;There is always room to improve and to build upon the efforts of the creative minded open and willing to experiment community.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;The first version&lt;/span&gt; ...&lt;br /&gt;Of this framework will feature entirely OO AS 2.0 code compatible with Flash player version 7. Soon after we intend to  release an amended version that will be fully compatible with the recently released Flash player 8 and will take advantage of some of its new features.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Sincerely Gugga Team</content><link rel='alternate' type='text/html' href='http://www.gugga.com/flashblog/2005/11/purpose-and-scope-of-this-blog.html' title='Purpose and Scope of this blog'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18955489&amp;postID=113198502124791315' title='1 Comments'/><link rel='replies' type='application/atom+xml' href='http://www.gugga.com/flashblog/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18955489/posts/default/113198502124791315'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18955489/posts/default/113198502124791315'/><author><name>sotirov</name></author></entry></feed>