1495606349 ActionScript 3.0 Design Patterns: Object Oriented Programming Techniques (Adobe Developer Library) - Mobile Development - Books - Books - GameDev.net

Jump to content

Game Development Books

  • You cannot edit this book

ActionScript 3.0 Design Patterns: Object Oriented Programming Techniques (Adobe Developer Library) ****-

ActionScript 3.0 Design Patterns: Object Oriented Programming Techniques (Adobe Developer Library) By William Sanders, Chandima Cumaranatunge
Published July 2007
List Price: $44.99, Your Amazon.com Price: $29.16

Amazon.com Sales Rank: 2,010,818
Availability: Usually ships in 24 hours

Now that ActionScript is reengineered from top to bottom as a true object-oriented programming (OOP) language, reusable design patterns are an ideal way to solve common problems in Flash and Flex applications. If you're an experienced Flash or Flex developer ready to tackle sophisticated programming techniques with ActionScript 3.0, this hands-on introduction to design patterns is the book you need.

ActionScript 3.0 Design Patterns takes you step by step through the process, first by explaining how design patterns provide a clear road map for structuring code that actually makes OOP languages easier to learn and use. You then learn about various types of design patterns and construct small abstract examples before trying your hand at building full-fledged working applications outlined in the book. Topics in ActionScript 3.0 Design Patterns include:

* Key features of ActionScript 3.0 and why it became an OOP language
* OOP characteristics, such as classes, abstraction, inheritance, and polymorphism
* The benefits of using design patterns
* Creational patterns, including Factory and Singleton patterns
* Structural patterns, including Decorator, Adapter, and Composite patterns
* Behavioral patterns, including Command, Observer, Strategy, and State patterns
* Multiple design patterns, including Model-View-Controller and Symmetric Proxy designs

During the course of the book, you'll work with examples of increasing complexity, such as an e-business application with service options that users can select, an interface for selecting a class of products and individual products in each class, an action game application, a video record and playback application, and many more. Whether you're coming to Flash and Flex from Java or C++, or have experience with ActionScript 2.0, ActionScript 3.0 Design Patterns will have you constructing truly elegant solutions for your Flash and Flex applications in no time.

Buy it now:

  • You cannot edit this book


Nov 05 2007 01:45 PM
Design patterns are things that live outside objects. If objects are NFL football games, then design patterns are the NFL draft – the game that lives outside of what is commonly thought of as the game. Design patterns aren't so much objects unto themselves so much as they are ways of doing common object-oriented tasks across objects, whether done with a single object or a system. While patterns are based on objects, they're really more akin to ways that objects are made or common non-trivial features that objects or entire applications often require. Patterns are usually associated with C++, an object-oriented language that supports the minimal "big three" standard of object oriented languages (encapsulation, inheritance, polymorphism) as well as about a jillion other features associated with industrial-strength OO languages.

. . .which seems to run exactly counter to ActionScript, a language based on ECMAscript (aka javascript, aka Jscript), which is a language mostly notable for being popular for writing one-line programs to do such useful things as make sure that your web-page isn’t running in an HTML frame. Fact is, ActionScript, while still a close cousin to the language used for one-liner HTML hacks in millions of web pages, has grown up quite a bit in its three or four re-imaginings by the ECMA committee. And while it doesn't have the scope of C++, ActionScript 3.0 does support lots of "programming in the large" features, thus making patterns useful things even for it.

Which brings me to ActionScript 3.0 Design Patterns, which brings Singleton, Factory, and all of the "classic" patterns to Flash/Flex's native scripting language. If this all sounds a mite daunting, it's not so bad. Given ActionScript's animation-tool roots, it's a foregone conclusion that AS's densest OO manuals are cakewalks compared to what's out there for the C++ crowd. The book opens with an overview of OO concepts, although it's not deep enough to render you as one who "thinks in objects" from the first read. Even though patterns aren't beginner-level material, ActionScript 3.0 Design Patterns isn't all that intimidating.

Although AS 3.0 is available for both Flex 2 (and the upcoming version 3) as well as Flash CS3, be aware that all of the examples used in the book are associated with Flash CS3. Many of the examples and all of the screenshots are Flash-centric. This isn't much of a problem, but here and there you'll run into something that's unavailable in Flex (like examples of attaching ActionScript code to a MovieClip object in the library), and you'll have to employ some alternate methods in Flex. This book, however, isn't a Flash tutorial, so it's really all about code and not the Flash IDE, so it's not that much of a problem.

One question you must eventually ask yourself before plunking down $36 (Amazon price at the time of this review) for ActionScript 3.0 Design Patterns is "What will patterns do for me". Since ActionScript is nowadays used for everything from "Punch Osama and win a plasma TV" banner ads to complete Office-class productivity applications, the question's not obvious. A banner-ad that's slapped together in ten minutes will likely not see any productivity improvements from design patterns, but a large web-based application or game certainly would. The actual "sweet spot" where design patterns will help you out is somewhere in-between. Thankfully, ActionScript 3.0 Design Patterns keeps its own examples small, which does turn out to be helpful. The advantage of a singleton is shown with a little "shoot the circles" game rather than a tiny part of an un-implemented word processing app. This is actually an asset of the book, not only because you get to see design patterns implemented in tangible programs rather than hypothetical examples, but it also shows how patterns can apply to small stuff. And what is a big program if not a collection of smaller stuff (doubly so in Flash, where programs tend to resemble hives of concurrently-executing bees)?

Also, there's really not a particular model that your app must follow, assuming you're not using patterns that are so specific that they’re married to a particular class of application. Some common patterns like Model-View-Controller (which has its own chapter), are really best employed in document-centric apps. Some of the classes, though, like the state machine, were just born for simulations and games. Unless you're writing something fairly trivial or are targeting ActionScript 2, you'll probably find something in this book that you can use directly.

ActionScript 3.0 Design Patterns is a very approachable guide to pattern-based programming in ActionScript 3.0. It's not a complete OO programming tutorial, although there's enough of it there to get you going (save for lots of practice) in the real world. The examples are all approachable and are complete.
If I was to have a beef with the book, it'd be that the examples as well as the abstract classes aren't included with the book (i.e. a CD) or as a download. While it's not a real problem to type in the abstract class definition for the included state machine class, it'd be nicer if I could just cut-n-paste it. I am, at heart, a lazy lazy man.