The library is available on github at bustardcelly/as3flobile. You can read more detailed information on the wiki. You can also look at the online docs. Continue reading if you enjoy rambling explanations.
As per usual, i had started a personal project that focused on refining parts of an old application and ended up creating a new library. This time, that application was going to get a face lift as i tried to port some code over to AS3-only views with the goal of targeting Android devices. What seemed like a little side project turned into a fun, can’t-stop-thinking-about suite of custom ActionScript 3 components.
You can view the components here: http://www.custardbelly.com/android/froyo/as3flobile/. If you have a Flash-enabled device, please check them out and let me know how they run. I have only really tested on my Nexus 1.
A full list of the current components is available on the project’s wiki in github. The main intent of creating these controls was to start thinking about user gesture as recognition and navigation within a control. My first task was to forget about scrollbars. They have essentially become useless on touch-devices in the context of navigating through content of a defined area. Though as3flobile does provide scrollbars in a sense (they are called Sliders) they are meant for selecting a value within a range, not as a handrail to hold onto to traverse items in a list. As a visual clue, the scrollbar still makes sense. As a user-input model, it is slowly not.
In any event, scrolling was the first gesture tackled. So I mainly started out making a ScrollViewport and then went crazy making all these other controls i know i would need if i ever got back to the original task at hand I could talk more in depth on how i tackled scrolling and how i kept the API open for you to create your own scrolling contexts and plug them in in later posts if you’d like.
There is some tap recognition, such as when selecting a list item or a RadioButton, but most of the focus is on swipe gesture for scrolling. I would like to start diving into other gestures (ie. zoom) which would probably make me rethink the architecture of a custom component for a touch-device, not only in its gesture recognition but also how you interact to access information. For instance, does a drop down really make any sense any more? (though there is a DropDown in as3flobile) I don’t know if i am the only one, but it really feels antiquated to me. I wonder if there will come a time when we are old and we look at old pictures of the online forms we used to fill out with there funny old clunky controls… how much time was wasted.
You keep talking, but can you skin them?
Yes, you can skin them. There really isn’t a skinning architecture in as3flobile per se. Any control that is a subclass of AS3FlobileComponent (which all the controls in the library currently are) can accept an ISkin and can maintain a state related to or rather accessible by an ISkin. Furthermore, the assignment, targeting and update to the skins is handled within AS3FlobileComponent with protected hook-ins you can override if seen fit.
However, if you look at the default skins within as3flobile, in com.custardbelly.as3flobile.skins.*, you’ll see that the ISkin implementations actually reference their target controls directly to access the graphic displays needed for custom skinning. I figured there was no reason to add extra overhead by creating interfaces for a control strictly for skinning purposes. If you create a custom skin for a control, it is assumed you know what the control needs to look like; so access it directly. Though the target property of ISkin is ISkinnable (which AS3FlobileComponent implements), the target is most times cast to the specific control that is being skinned. If people are really interested in these components and curious as to how to skin them, i can definitely fire up some more posts on that.
In any event, i hope you check out the as3flobileproject in github and/or get down to business as Gary always seems to do. If you do check out the as3flobile project, suggestions, comments and questions are always appreciated. I am sure there are some bugs and some aspects of the controls that i just didn’t think of that may be needed.
I had the great pleasure to be interviewed on RIARadio and be in the company of Garth Braithwaite, Stacey Mulcahy, Leif Wells and Josh (oooahhh) Noble. Thanks for having me on! I had a great time and i sound pretty good in the reverse auto-tune affect that Garth put on my voice so as to sound like a nasally jersey kid.
ps. If you listen and are confused as to what Josh looks like, here is a picture of him ->
That’s him on the shark… obviously, someone shopped in the grenade launcher but a nice picture of him from his good side, nonetheless. So if you see him at FlashBelt, say hello for me!
The library is available on github at bustardcelly/as3couchdb. You can read more detailed information on the wiki. Continue reading to hear me blab on and on.
When the new year came and i had finally got in my last chapter for Flex 4 Cookbook, it was time to return to my list of things to learn. I started looking into Capuccino and Closure and bought a book on Python. Somewhere along the way i just clicked on some tweet about 5 emerging trends that i must know about. Usually i find these lists are a grain-of-salt bandwagon of buzzery – maybe some truth but can’t cut through the true meaning of why this person is writing about them. But one did stick – NoSQL. I looked into the different implementations and right away i took a fancy to CouchDB. I don’t know why. It seemed quite simple. Working with a database using REST calls. Sounds good. And i could write my own map-reduce views in Javascript. Sign me up.
What also was a big draw to me was the concept of document revisions in CouchDB. I had worked on a couple projects that required online/offline synchronization and it was quite a pain to keep track of last modified entries and cleanup of deleted entries in a SQL database. The revisioning system for documents (entries) is built into CouchDB and what is more is that you are not locked into a rigid data structure and ensure your table relations are scalable. That’s not to say that building relational databases isn’t a fine art. It is. And there are many smarter people than me that get paid more money that have that craft. I don’t. The concept of revisions is familiar to me and i am greatly intrigued by the concept of NoSQL.
Anyway, i started digging into CouchDB and figured the one way for me to see the whole picture was to hook up a client side end to make these requests. See if what i was reading about was something i could use as a different approach to online/offline synchronization in my applications. What came out was a whole library for working with databases and documents of a CouchDB instance – a library which is now available on github at http://github.com/bustardcelly/as3couchdb.
Took me long enough to get talking about the as3couchdb library mentioned in the title, didn’t it? Well, you can read more long-winded explanations about the make-up of the library from the wiki on github, and browse some examples that use the library (currently all Flex examples, but AS3 examples are coming soon).
If you are still around, i can give a brief synopsis of the project:
When i set out on creating the as3couchdb library, i knew i wanted to follow a similar approach to Data Access Objects. I wanted to make all my requests through the object i was working with and have an intermediate layer that communicate with the service and updated the object accordingly. To achieve this, i went about creating a base model class that contains a model entity. The model entity is really only involved in parsing custom metadata and resolving the information to properties held on the base model. Extending the base model are the two core models of CouchDB that you interact with: the Database and the Document.
So the Database and Document models can be though of as the Business Objects and expose methods that related to CRUD operations. Even though CouchDB has a REST API, i chose using simple CRUD method signitures on the models as they seem easier to read and understand. From these methods, the models interact with a service mediator (similar to Data Access Object), which knows how to communicate with the service proxy and has action handlers that know how to modify the model once a successful result is received. To put it in code terms:
I wanted to have the ease of creating and storing a document as such
var contact:ContactDocument = new ContactDocument();
contact.firstName = "Todd";
contact.lastName = "Anderson";
contact.addEventListener(CouchActionType.CREATE, handleContactCreate);
contact.create();
And the ease to simply read in for modification as such:
var contact:ContactDocument = new ContactDocument();
contact.addEventListener(CoachActionType.READ, handleContactRead);
contact.read( $uid );
In order to make this all work and auto-wire the models with a service mediator, custom annotations were needed. This is where the model entity mentioned earlier comes into play. When extending the core models (as ContactDocument does in the previous examples) you add custom metadata that relates to the CouchDB instance you intend to work with and the fully qualified classnames of the target service mediator and request object.
Now the request object is a different story and was brought into the picture due to the lack of HTTP method types available for the web version of Flash Player. As such, there are a couple different request object types available in as3couchdb: straight-up devil-may-care requests using URLRequest (mainly for AIR or you will get RTEs), one that uses External Interface, and one that uses as3httpclientlib. The as3httpclientlib allows you to make PUT and DELETE requests using a Socket and is the best way to interact with a RESTful service when limited to the Flash web player (imho).
So that is a brief rundown of the model and business layer implementation i strove for when creating as3couchdb. As i mentioned way back in upward-page-scroll land, the original drive to make as3couchdb was to see if i could ease up the pain of developing an application that uses online/offline synchronization. That is in the works and maybe this blog will become a little more active as I dive into that task.
If you made it this far, thank you for reading all this. Wow. You are a trooper. Tell your boss i said it is okay and you can bill that time.
Following the announcement of the Flex 4 SDK release, i thought i would mention a little something about a publication i have had the pleasure to be apart of (again! Big ups to Josh). The Flex 4 Cookbook from O’Reilly Media is expected to be dropped on May 15th 2010 and you can pre-order yours (and your loved one’s) today.
With the paradigm shifts in architecture from Flex 3 to Flex 4, the Flex 4 Cookbook is hardly an ‘updated’ version of the last. I had the pleasure i’ve diving deeper into the new SDK along side some extremely talented folks. Josh and I snagged Garth Braithwaite (of InsideRIA and Flash Community fame) and forced asked him to contribute his knowledge and expertise and we also snatched up David Tucker, Rich Tretola and Marco Casario of the Adobe AIR 1.5 Cookbook and dedicated a few chapters to Adobe AIR 2.0.
What could come of such a stellar line-up? More pages of writing than can be published that has been gratefully edited down to coherent sentences by the O’Reilly publishing team. And maybe a few laughs.
This is a huge step in the Flex 4 SDK and, in my opinion, a much needed step and the correct vision of the future of development for the Flash Platform. The Flex 4 engineers did an amazing job and i highly recommend downloading the SDK and playing around. The separation of responsibilities within the new Spark component architecture is a huge boost in my workflow and a stellar achievement.
[UPDATE: April 26th, 2010]
This post was originally written after playing around with a nightly build of the Flex SDK many months before it was officially released. Since that release, there has been more traffic to this post from people looking for a Spark Viewstack solution (assuming), however the SDK had changed since the initial example within this post. As such, i have only updated the source and inline code within the post. I am keeping the original wording of the post for prosperity sake.
I’ll start off by saying that i love what is happening with the Spark architecture in the Flex SDK. When the time comes that we at IR5 are given the green-light to use it in production for clients, i will be giddy. That said, I am aware that a lot of people have gripes about the lack of complete parity between the Halo and Spark sets, and particularly the lack of Spark equivalents for the Halo navigation containers such as Accordion and ViewStack.
Truth be told, they probably have good reason to not hop on board, and without raising your voice you can’t raise concerns to the owners of the Platform to make informed decisions based on feedback. However, I feel the Platform developed because people started doing things it was never intended to do and (while at times complaining) developers just rolled up their sleeves and bent the code to their will. Now this is going into a whole ‘nother discussion that was the intent of the post, so we’ll just leave the discussion at that and ask, ‘Why not make what is not there?’ The answer is a whole ‘nother discussion and I am fully aware that the SDK is not *perfect* for this, but it is available to make something work somehow… that’s how we all got here.
Enough jibber-jabber… I set apart a couple hours to make a ViewStack for Flex 4 just to see how easy it would be with the Spark architecture. Honestly, I never really use the Halo navigation containers much – maybe some quick prototypes here and there, but have always found that in a medium to large application they provide no benefits that go along with their overhead. But still, I thought i would choose one (and yes i know it is probably the easiest one ) just to see what all the fuss was about.
My first step was getting excited about the mxmlContent and mxmlContentFactory properties available on Spark containers. ‘think of the possiblities,’ my mind said, ‘this probably contains all the declared children within the markup!’ Oh with that i can stop instantiation of them and deferred until requested. Case closed. Viewstack done. Until i realized that most everything that handles these values is private. bugger.
[Update 2009-09-03]
Event though i did start down the path of mxmlContent and mxmlContentFactory and came up empty, thanks to the brain on Ash Atkins for pointing out that i coudl use the [DefaultProperty] metatag to still allow inline declaration of child elements for the ViewStack. The inline code has been updated. Thanks, Ash! [/Update]
Next step was extending SkinnableContainer and just exposing a property on which you can pass an array of IVisualElement instances, along with the standard selectedIndex and selectedChildren. With the new Flex 4 Declarations tag, this solution was made sweeter in that I could declare my children without instantiating them directly and could pass them along for the Flex 4 Viewstack to handle them as seen fit, allowing for deferred instantation. Making sure set selectedIndex and selectedChild work accordingly and dispatch an event on change of index, i called it a day. It took a couple hours and I called it a day… until Keith walked into my office and started yammering about me not working.
Example. Made with Flex 4 SDK build 9864. You will need the latest player:
view source . There seems to be bug in the view source code in the nightly builds, so i will post the code here as well if you don’t feel like Right Click> View Source and downloading the zip…
Here is the implementation i came up with:
// -----------------------------------------------------------// CBViewStack.as// -----------------------------------------------------------/**
* Copyright (c) 2009 Todd Anderson. All Right Reserved.
*
* Code provided has not been tested in a production environment
* and should be used by another party at their own risk. I disclaim any
* and all responsibility for any loss or damage of property that may occur
* from using it.
*
* ===================================
* custardbelly.com
*/
package com.custardbelly.container{import mx.core.IVisualElement;
import spark.components.BorderContainer;
import spark.components.SkinnableContainer;
import spark.core.IViewport;
import spark.events.IndexChangeEvent;
/**
* Dispatched on change to selectedIndex property value.
*/[Event(name="change", type="spark.events.IndexChangeEvent")]/**
* Basic implementation of a ViewStack container targeting the Spark environment.
* CBViewStack inherently supports deferred instantiation. All methods and properties
* have been made protected in order to subclass and implement any desired creation
* policy.
*
* Child content cannot be added in markup due to the black-boxing of the mxmlContent and
* mxmlContentFactory properties and corresponding methods. As such, supply content to the
* CBViewStack using the <b>content</b> property. The <b>content</b> property is an array
* of declared IVisibleElement instances.
*
* To enable scrolling of content added to the display list of CBViewStack, it is recommended
* the either programatically control the viewport with an external scrollbar or wrap the
* container in a <s :Scroller> instance.
*
* The <b>content</b> and <b>selectedIndex</b> properties can be set in-line in MXML.
* The <b>selectedChild</b> property can only be set within ActionScript.
*/[Event(name="change", type="spark.events.IndexChangeEvent")][DefaultProperty("content")]publicclass CBViewStack extends BorderContainer
{/**
* Represents the collection of IVisualElement instances to be displayed.
*/[ArrayElementType("mx.core.IVisualElement")]
protected var _content:Array;
/**
* The index within the colleciton of IVisualElements to be added to the display list.
*/
protected var _selectedIndex:int = -1;
/**
* Represents the current IVisualElement on the display list.
*/
protected var _selectedChild:IVisualElement
/**
* Held value for selectedIndex.
*/
protected var _pendingSelectedIndex:int = -1;
/**
* @private
*
* Override to update selectedIndex and subsequently content on the display list.
*/
override protected function commitProperties() : void{super.commitProperties();
// if pending change to selectedIndex property.if( _pendingSelectedIndex != -1){// commit the change.
updateSelectedIndex( _pendingSelectedIndex );
// set pending back to default.
_pendingSelectedIndex = -1;
}}/**
* Updates the selectedIndex value and subsequent display.
* @param index int The value representing the selected child index within the content property.
*/
protected function updateSelectedIndex(index:int):void{// store old for event.var oldIndex:int = _selectedIndex;
// set new.
_selectedIndex = index;
// remove old element.if( numElements >0)
removeElementAt(0);
// add new element.
selectedChild = _content[_selectedIndex];
addElement( _selectedChild );
// dispatch index change.
dispatchEvent(new IndexChangeEvent( IndexChangeEvent.CHANGE, false, false, oldIndex, _selectedIndex ));
}/**
* Returns the elemental index of the IVisualElement from the content array.
* @param element IVisualElement The IVisualElement instance to find in the content array.
* @return int The elemental index in which the IVisualElement resides. If not available returns -1.
*
*/privatefunction getElementIndexFromContent( element:IVisualElement ):int{if( _content == null)return -1;
var i:int = _content.length;
var contentElement:IVisualElement;
while( --i > -1){
contentElement = _content[i] as IVisualElement;
if( contentElement == element ){break;
}}return i;
}[Bindable]/**
* Sets the array of IVisualElement instances to display based on selectedIndex and selectedChild.
* CBViewStack inherently supports deferred instantiation, creating and adding only IVisualElements
* that are requested for display.
* @return Array
*/publicfunctionget content():Array/*IVisualElement*/{return _content;
}publicfunctionset content( value:Array/*IVisualElement*/):void{
_content = value;
// update selected index based on pending operations.
selectedIndex = _pendingSelectedIndex == -1 ? 0 : _pendingSelectedIndex;
}[Bindable]/**
* Sets the selectedIndex to be used to add an IVisualElement instance from the content property
* to the display list.
* @return int
*/publicfunctionget selectedIndex():int{return _pendingSelectedIndex != -1 ? _pendingSelectedIndex : _selectedIndex;
}publicfunctionset selectedIndex( value:int):void{if( _selectedIndex == value )return;
_pendingSelectedIndex = value;
invalidateProperties();
}[Bindable]/**
* Sets the selectedChild to be added to the display list form the content array.
* SelectedChild can only be set in ActionScript and will not be properly updated
* if added inline in MXML declaration.
* @return IVisualElement
*/publicfunctionget selectedChild():IVisualElement
{return _selectedChild;
}publicfunctionset selectedChild( value:IVisualElement ):void{if( _selectedChild == value )return;
// if not pending operation on selectedIndex, induce.if( _pendingSelectedIndex == -1){var proposedIndex:int = getElementIndexFromContent( value );
selectedIndex = proposedIndex;
}// else just hold a reference for binding update.else _selectedChild = value;
}}}</s>
So that is basically it. Allow for skinning of the Viewstack by extending SkinnableContainer. Expose content, selectedIndex and selectedChild properties. Dispatch and index change event. Optionally wrap CVBViewStack in a Scroller to enable child content that extends the viewport of the viewstack. I know it probably won’t serve every need, but in a few short hours I made Viewstakc in Flex 4 for the purposes i mainly use it for in prototypes. I haven’t put it through the ringer in testing, but feel free to. There’s no license, completely free. Modify, take, steal, have fun.
*Note: Seems as though the generated ‘View Source’ files in the nightly build from September 1st (of which i mad the example) has some bugs. So feel free to click this link -> view source < - but be aware that you won't actually be able to view the class files in the browser. You will need to download the zip file.
… not that you’d actually be going to see this handsome fellow. That’s the look i give when they run out of Stone Ruination IPA.
Aah. When springtime in Boston hits, the weather is still cold for a couple months and the beer is flowing again. Actually, the beer flows all the time and the weather is unpredictable. Nonetheless, you know you are in for a good time, and i am looking forward to the Flash On Tap debut in my home town.
The beer sponsor list is amazing. Most beers you won’t be able to find on tap in our fair city, let alone the lot of them all in one place – aside from *possibly* my neighborhood haunts in Brookline (hit em up when you are out here). Stone, Smuttynose, Haverhill, Boulder.. the list goes on. In that order for me at least. I am excited about Haverhill, because even though it is a local brew (you gotta try, their LeatherLips it is awesome) some i have not tried because they are just not out here in my brick-filled neck of the woods.
Oh yeah… And then there’s gonna be some people rambling on about what-nots and crap. If you ain’t pourin’, i’m snorin’. That’s what i say. In all seriousness, the line up is insane. The beer is just icing on a knowledge cake waiting to cook.
See my sad face and full belly as i drink all the Ruination.
In between work, taming a new puppy and twilighting as an iPhone SDK newbie, i have been busy working on a personal project that has taken way too long to see the light of day. I began working on an AIR application last summer to overcome an incongruency in the middle tier of how i go about finding and purchasing new music… out came a little desktop app i call MUWL.
MUWL stands for MUsic Wish List and allows you to amass a list of albums that you hope one day will make it into your collection.
You can read more detailed information about MUWL from the custardwiki… and/or just keep reading.
I am a sucker for record shops. I love flipping through vinyl and jewel cases – sometimes aimlessly, sometimes with a purpose – and bringing home musty and off-the-press platters. Before i created MUWL, i would discover music that i was into either online through various blogs and what-nots or from word-of-mouth. Problem was, i would write down titles on any scrap of paper that was near me in the hopes that i would remember to shove it in my pocket when i knew i was going to a shop.
There was two major flaws in that system: a) I hardly EVER remembered to bring my scraps of paper and b) Some times i wind up in a record shop without a preconceived notion to go.
To rectify this sorry state of affairs, i thought i could make an app that would allow me to keep that list in one place and could be viewed by any device i might be carrying around with me. Now, i know, i know, why make a application targeting the Flash Platform if you wanted it to be on ANY device… ahem. Well, i just needed a client that i could create fairly quickly that would hook up to an online service. Seeing as i am familiar with the Flex and AIR SDKs, i thought it would get me closer to my goal – plus it would give me a chance to architect an application that supported occasional-activity and offline/remote data synchronization.
Even though i am targeting the Flash Platform for the MUWL desktop application, i wanted to stay away from the AMF protocol (which i would normally use in such a case) in order to keep it open to non-Flash clients that i may make in the future… the main one being a companion iPhone app. As such i went with XML over HTTP and created a REST service using Ruby on Rails.
I built the REST service that MUWL desktop AIR application talks to in Ruby because it has been on my list of things to get familiar with… and it was already installed on my server, so i figured why not. I gotta say i really loved working with Ruby on Rails. We’ll see how much i love i still have for it if more than just me uses the application
Other than a companion iPhone app, i have some other ideas on what to add to the client application. If you download and use MUWL and have any thoughts (or god forbid bugs), let me know.
Last week I was fortunate enough to be asked by Doug and Sam who run the BDP (Boston Design Patterns meet-up… NOT Boogie Down Productions) to present on Dependency Injection and Inversion of Control (DI and IoC for those who are down with street acronyms).
We had a nice turnout and a lively discussion that kept interupting my precious slides. I gave a quick run down of the Dependency Inversion principal and some examples for Factory and Template Method with segued into Dependency Injection and IoC. From there we dove into examples of frameworks out there that target the Flash Platform. Along the way we had some hefty discussion around the benefits and downsides with everyone chiming in. Tim Walling also brought up how he addresses DI using MXML and modules which was very intriguing.
As far as runtime IoC frameworks out there targeting the Flash Platform, we discussed Spring ActionScript (nee Prana) and Parsley. I’ve been using Spring ActionScript/Prana for some time and swear by it. But i also did take a second look at Parsley just to refresh my memory and I have to say there are some things that i find very promising, though at times it seems there might be too much to it. So many things i would not use… but the ability to configure custom namespaces looks like an amazing feature.
As far as compile time IoC, we touched on Swiz and the EventMap of Mate. Both have their upsides and Swiz has definitely caught my interest (…may have to find a personal project for me to get into it more) but all in all, I have a tendency to favor external configurations. (For those worried about having to do the static variable array list of classes hack because of that, there is an example in the download zip at the end of this post.)
In any event, it was a good, lively discussion with some smart people and some great beer (thanks again Doug!). It’s no wonder that getting to the meetings more often is top on my resolution list for this year. If you are in the Boston area, think about putting it on your list too.
*This is more of a post-reminder or a google-search aha than a soliloquy on the joys of FlexTasks and how to use them. If you want to know more about flextasks, visit here, or Ryan Taylor’s blog for some good tips, or pick up this wonderful book… the holidays are coming.
I have had the fortunate opportunity to work with Andy Zupko on a project here at Infrared5. We have our good days and our bad days – as most projects go – and hopefully we’ll be able to showcase our efforts at some time. Recently i started whipping the project into shape to handle modules, rsls and loaded styles to minimize the download time and highten user experience. Why does it always come down to the last few days to get this up and running? I don’t know. Maybe we’re so gung-ho to get things finished for an iteration and to show a client that deployment structure falls a little to the wayside. In any event Andy, and in some part me i suppose, structured the project to have minimal impact when it came time to have a deployment routine and manage runtime styles and rsls. Enough horn-tooting! What am i talking about?
Well, when it came time to set up the ant tasks that will take over the deployment and distribution of the application i was hitting a wall in compiling against an rsl. More to the point, i was getting this error:
BUILD FAILED : No directory specified for FlexFileSet.
I’m not gonna go into the nuts and bolts of the build file or even attempt to explain what that error means. I am familiar with compiling applications and modules from the Terminal and pretty much love doing most things from the terminal rather than relying on tools in eclipse, but i thought to bring experience down to a playing ground for a project that will be handed off to a client at some point, go with flex ant tasks. It’s well documented. Google finds most answers. Etc. But there are subtle changes to syntax that i am unfamiliar with when it comes to create a build file targeting the command line tools of the SDK.
In any event, it baffled me why this command would not work. It syntactically looked correct to me. The compiler directive is spelled correctly, the option variable is the correct path… wtf. Well just like the -library-path option i suppose you had to remove the directory that the SWC lives in from the variable and add it as a dir property.
Works! All is fine… but it took a hell of a long time to figure that out. Thought i would post this for any Terminal monkeys out there that run across this issue when building an ant file for compiling rsls into your application.
Was I bone-head for 2 hours? Probably…. feel free to leave a comment.
[Update February 3rd, 2009] – Ryan Taylor sent a solution that he uses (after being welcomed by my wordpress comments failure), which i find pretty elegant and will use in the future.
Just got back from Adobe MAX and a sweet short vacation for the missus and i. Been to SF only once, when i was 9, and all i cared about were Garbage Pail Kids and pleading with my mom to buy me some Nikes. Needless to say, i remember – i think – a lot more about this last trip.
I was overjoyed to be able to sit on the Flex Architecture Face-Off panel with Chafic Kazoun, Josh Noble and Yakov Fain. They are amazing architects with strong beliefs and open ears. We had a pretty good turnout and the session ended up being sold out. Only noticed one person walk out, but as it turns out they were over-caffeinated…
It was my first MAX and i didn’t know what to expect with the record-breaking attendance and my bundle of nerves. All said, i really enjoyed it and renewed my interest in the software platform that constantly evolves and inspires me to keep digging even after the workday is over. Of course it was centered around Adobe products, but i truly got the sense of it being a presentation rather than being force-fed. A lot of great things are on the horizon and even though i am a mark-up snob in a sense, i love the direction that the Flex platform is taking. Would have liked more ‘inspire’ sessions, but Ryan Taylor, Andre Michelle and Mario Klingemann kept me wide-eyed and ready to go back to my room to code… although there always seemed to be free beer that blocked the exit
Adobe also sponsored a party on Tuesday night at the de Young and Science Academy. I thought that these were venerable institutions in Golden Gate park, but it was dark and as I later found out after going with the missus again later in the week that the are relatively new. If you are in the SF area anytime soon, i highly recommend checking them out. That was a great night with two great museums and some really great friends… plus me and Josh schooled some poor saps in Foosball… after i got schooled in NBA Jams by Ash – rematch, all i’ll say.
Some people found me after our panel and had some questions about things i brought up that i wish i could have gone into further:
1. As far as specs, docs and architecture go, I think your best bet is Enterprise Architect. That is, unless you are on a Mac in which case it is not available and i prefer Omnigraffle.
2. I briefly mentioned Prana and IoC as a segue from scaffolding and I wish i had more time to devote to it during the panel. Though Mate does support some dependency injection for their event mapping, it is compiled in and i prefer an external application context that can be configured for runtime. We use it heavily at Infrared5 and I would whole-heartedly suggest you look into it for your next project – Prana developed by Christophe Herreman.
3. On the panel, we were all familiar with Cairngorm and mostly use it when business requirements and dev team size makes it a perfect fit. But i did bring up the black hole of state control that comes with it… in my opinion. I am quite taken with how PureMVC handles state through mediators, but i have other weight-baring problems with PureMVC that i can’t get around that make me choose Cairngorm when it comes to incorporating a micro-architecture into our projects. I basically said that i hate throwing string-denoted state on the ModelLocator that is bound to a view. I can’t stand it, but i do it because i know that developers are familiar with it. In my personal opinion i think this is the best case for the Strategy pattern. I like the Mediator pattern as well, but i think there is too much baggage and extra code that needs to be thrown in an if..else of switch..case. I know that Strategy is behaviour pattern but i see it fitting in nicely with presentation as well. I can go into that farther in another post if you all want, but i just wanted to convey that even though you might represent a simple string on a global model, i think you are losing the loose-coupling infrastructure… but don’t even get me started on Singleton models… this 3 point has already run too long.
In any event, if you sat in on the panel, I would love to hear your thoughts – good, bad and ugly. Leave a comment… and bundle up, it’s cold here in boston.
Todd Anderson is a Senior Software Engineer for Infrared5.
At times i will release code freely for download that can be used at your own discretion.
… all i ask is that, unless otherwise noted, any and all work – due to the open format of the Flash player – be recognised under this Creative Commons License.
[...]more →