ActionScript.org Flash, Flex and ActionScript Resources - http://www.actionscript.org/resources
Review - Advanced ActionScript 3 with Design Patterns
http://www.actionscript.org/resources/articles/539/1/Review---Advanced-ActionScript-3-with-Design-Patterns/Page1.html
Jesse Stratford
Jesse lives and works in Melbourne Australia. He is the Cofounder and a Director of http://ActionScript.org. A Flash enthusiast, teacher, author, freelancer and speaker Jesse enjoys participating in the http://ActionScript.org community and the wider Flash scene when he has time. 
By Jesse Stratford
Published on 01/16/2007
 
This is a review of the Peachpit Press publication "Advanced ActionScript 3 with Design Patterns".

Snapshot

A strong, yet small book which provides a solid introduction to best practices in general, not just Design Patterns. Recommended for anyone who considers themselves an ActionScript coding professional, or aspires to become one one.


ActionScript Design Patterns, yay!
Title: Advanced ActionScript 3 with Design Patterns
Authors: Joey Lot and Danny Patterson
Published by: Peachpit Press (Adobe Press), 2006
Level: Advanced
Pages: Under 300

Snapshot

9/10, or 4.5 stars.

A strong, yet small book which provides a solid introduction to best practices in general, not just Design Patterns. Recommended for anyone who considers themselves an ActionScript coding professional, or aspires to become one one.

Pros

  • Assumes very little about existing Software Engineering knowledge;
  • Concise yet thorough descriptions of complex topics;
  • Practical worked examples of techniques discussed;
  • Remains interesting, which is sometimes a challenge for such theoretical concepts;
  • Not a bible.

Cons

  • Not a bible;
  • Some quirks.

Review

Setting the scene

OK, before I begin, first I have to declare an interest. I have a Software Engineering degree. That means my mind has been corrupted with the virtues of best practices for years on end, and I was likely to give any book which brought them to the forefront of the ActionScript community's collective mind a pretty good review.

However, I think I have counter-set that terrible brainwashing with a few good years in industry where I learned one all important lesson; best practices are really useful… except, they are only useful when the project warrants their use, and when used to the extent necessary. I was happy to see that this little lesson is one of the first topics discussed in this book. But we're getting ahead of ourselves.

Advanced ActionScript 3 with Design Patterns (henceforth AA3WDP) is not just about Design Patterns, it's about best practices software engineering, with a focus on Design Patterns and their application in the world of ActionScript. Design Patterns, put simply, are theoretical frameworks for solving common coding problems in a smart way (no nasty hacks). They can be transported across languages, and that's exactly what this book does; provides you with examples of how to implement, in ActionScript, some of the world's best practice Design Patterns for various scenarios; e.g. developing an interactive online Rich Internet Application with the MVC pattern.

But it does much more than that. To begin with, Chapter 1 rocks the foundations of so many ActionScripters' lives, by raising the all-important difference between the analysis, design and development phases of building an application.

Most of the time when you have a project to do in ActionScript, you jump straight into coding, don't you? Admit it! I saw the look in your eyes! Of course, this is fine for a lot of projects, because they are not complex enough to warrant anything more. But what about when you get that new job with a big ActionScript development firm in the city? Or when you want to start working as one of a team of developers in the open-source community, pumping out a great new… something? You're going to need to be able to break the work down into bite-sized pieces for allocation. You're going to have to build your pieces to a specification and meet it to the letter; otherwise the whole project will fall to bits. And your code is going to have to be good; really good.

The rigor which comes as par for the course in a lot of programming languages has never really been a strong suit of the ActionScript community. And I'm not saying that's a bad thing. Look at half the stuff I've written and I'm sure you could poke a million holes in it; but it still works. Still, in real terms, ActionScript and the Flash platform have come a long way in a few short years, and harder nosed software engineering professionals are entering the scene. Want to keep up with Mr. Jones?

Believe it or not, this is the ActionScript world we live in. And it needs Best practices.


Savior of the day

Reading even the first chapter of AA3WDP is probably a good start. It whirls through the concepts of UML, Use Cases, CRC Cards, Encapsulation, Inheritance and Composition, and a variety of other Object Orientation principles. It gives good high level guidance to those who might already know how to write OO ActionScript but struggle with when and where to apply Object Orientation, and how to architect their applications.

Note the use of the terms "concepts" and "high level" above. None of the descriptions in this book will make you an expert in the relevant concepts. They will however make you aware of ways and means of approaching your work which people all over the world use for good reason. For those elements relevant to you, you can conduct your own further research to learn more, and hopefully achieve better results, which is what Best Practices are all about. (Importantly, in this review I'm not talking about best practices such as keeping all your code in a layer called 'ActionScript'. I'm talking about the software architecture of your Flash application; how you design the pieces, and how well they fit together.)

AA3WDP brings with it just enough information to entice the advanced ActionScript professional into the world of Best Practices only so far as they need to go to meet their ends. It gives you a taste of the virtues and downfalls of Design Patterns (in particular, but Best Practices more generally), without forcing you to read volumes.

Because this book is aimed at advanced ActionScript professionals, there is no fussing about with introductions to basic ActionScript concepts. Explanations of code are concise and assume you can read the code yourself, and get an idea of what it's doing. Things are explained once, and explained well. I must admit that many of these topics weren't new to me so I intentionally sought out those that were and read them fully. I found that they provided me with enough information to understand the concepts being discussed, and apply them at a high level. If I needed / wanted more detail, I would have to go elsewhere (e.g. online, or one of those tombs I had to buy at University *shudder*).

AA3WDP provides enough detail to leave you with a good understanding the concepts being put forward, and keep them in the back of your mind for when you may wish to apply them. It also provides enough of a practical example to get how the pieces fit together. If you still need more, there are volumes of free information online, and some great books written on each of the topics covered, to provide the added detail you may be seeking. Importantly, this book shows how to implement these concepts in object oriented, ActionScript 3 code, which is often the hardest part when it comes to following design patterns.

Advanced ActionScripters will find themselves recognizing concepts discussed in this book and realizing that the project they did yesterday, or last month applied that concept to an extent. In fact, the book itself doesn't go into too much depth about when you would use a certain best practice, or design pattern, but if you're a weathered ActionScripter, you'll probably recognize those automatically. You will also likely find that best practice approach may have provided you with a more elegant way of achieving the same result, or something which you could have more readily reused later on.

Ultimately this is a very good resource to have at your disposal. There are a few quirks; e.g. use of certain UML diagrams whose syntax is not explained (that I saw) in the book, and thus might not make sense to a casual reader, but I only point that out because I was looking for something bad to say.

If developing reasonable sized ActionScript applications (in Flex or Flash of any flavor) is a significant part of your day to day life, and you don't already know much about design patterns and general software engineering best practices, convince the boss (or spouse) that this is a worthwhile expense. It is.