Start of a semi-regular series called Flex Notebook which capture my thoughts on Flex as I distill the various Adobe-provided materials and user guides for myself.
Application Development Phases
Design. The folks at Adobe seem to be big on Design Patterns for Flex and ActionScript. The KingDaddy pattern that they push is the MVC - Model/View/Controller pattern. I'm not going to say too much about patterns except: 1) As a developer, you need to understand them so you can communicate with folks. The MVC pattern is something you should definitely take on as a task to understand today if you don't.
For the seasoned web guys, I want to make this note: Don't treat Flex as simply a V part in your architecture and feel that since it is a View you don't need to architect/design it. In fact, dig into most of the sample Flex apps and you will notice that the cool backend you are so interested in is reduced to a simple datasource in the minds of the Flex app -- a lot of MVC is happening inside the Flex app. Keep a open mind and consider that tiered MVC happens all over the place.
If you want a good book on design patterns for Flex/ActionScript, consider Lott and Patterson's Advanced ActionScript3 with Design Patterns.
Design also includes how you plan on reusing code for the future, how you are going to interact with environments around you (local and backend), how you components are structured and packaged (embedding assets, sharable libraries). All of this can be sketched out on a napkin or two or three. Get together with a senior mentor type person and have them show you some of their napkins.
Configure. Configuration at this point means looking at the environmental pieces of your design and asking if you can actually make this work in a distributed environment. Are there firewalls? Cross-domain data access? Can you configure the servers to allow cross domain access? Can you serve up the assets you need? For example, I tried using Flex inside a portlet being served up by WebSphere portal. Configuration research was a big piece making sure that we could actually deliver .swf files in portlets and extend the portal security into Flex. You are trying to reduce the risk of building something that works fine on your desktop, but can't be deployed into the real world.
Build. Compile-Debug-Test. Flex Builder does a lot of the heavy lifting for you, a little too much. Do you know the difference between compc and mxmlc? If you are a Flex Builder user, it may be worth your time to sidestep that tool and try to build your project by hand using the SDK command line tools. You don't have to do this every time, but you should have experience in doing it at least once. This will come in handy when you get to the point of trying to put Flex into an automated build process.
Flex and Air provide a variety of visual and command line debugging tools. We'll talk about this in greater detail later in the series. One thing to consider is the use of unit testing tools in your development process. We'll discuss later, but in the meantime, check out FlexUnit, a unit testing framework for Flex and ActionScript apps. It comes with a graphical runner as well.
Deploy. General considerations here: 1) Packaging. Do you put everything into one SWF, or do you chop up into pieces and load when needed. Embedding assets vs load on demand, Runtime Shared Libraries, and initial data loading are considerations. 2) Caching. Understand and control both server side and client side caching. 3) Wrapping Flex apps and placing them into web pages. Flex Builder can do automatically, or you can create a wrapper by hand.
Secure. The Flash Player provides a sandbox model of security and provides SSL communication with the backend. Flash does allow writing and reading from the local drives via a mechanism called SharedObjects. Like cookies, they are specific and secured to a specific domain. More on security in the next few weeks.
Summary. This was a fairly brief introduction into building and deploying Flex applications. In the upcoming weeks, we'll touch upon these topics in detail. Next Time: Flex Application Structure.
Wednesday, August 6, 2008
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment