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



Amazon.com Customer Reviews

Excellent - Review written on September 28, 2007
* * * *
Rating: 4 out of 5
4 customers found this review helpful, 1 did not.

Great book! The concepts shown are useful not only to action script but to any language at the enterprise development level.
Great Design Pattern Resource for ActionScript 3 Developers - Review written on August 31, 2007
* * * * *
Rating: 5 out of 5
10 customers found this review helpful.

This book is a solid resource for developers who want to fully embrace OOP concepts in their Flash and Flex projects.

With examples based on traditional GoF patterns, the authors demonstrate the use of OOP specifically for ActionScript 3 development. For someone like me, who's just getting their head around AS3 and large-scale RIAs, this book is invaluable.

It starts out with a good introduction to OOP, helping to familiarize those who are just getting started or who don't quite think in OOP terms just yet, with the over-arching principles. With AS getting closer and closer to Java structure, this introduction is especially helpful for AS developers. For those already comfortable thinking in OOP-terms, you may want to skip this section and dive into the meat of the book, which is quite substantial.

Each chapter addresses a specific design pattern, analyzes it's structure and benefits, and provides both an abstract example and real-world examples. This not only gives you the full understanding of the pattern, but also gives you an idea of how to implement it in your projects. This makes this book both a great overall OOP reference, but also a practical one.

If you are familiar with OOP, or just wrapping your head around it, I highly recommend this book to take your Flash and Flex projects to the next level.
Worse than uninformative, it's actually mis-leading - Review written on August 27, 2007
*
Rating: 1 out of 5
51 customers found this review helpful, 16 did not.

My biggest complaint with this book is that the authors basically just took the design patterns found in Java and C++ and re-implemented them to run under ActionScript 3 (AS3). The list is comprehensive, but it's clear that the authors don't "think in AS3".

In several core ways, AS3 is very different than Java and even more so with respect to C++. For instance, the event model is baked into the language and asynchronous programming is a different style. Also, XML and XPath are native constructs in ActionScript 3, not libraries like they are in other languages. These differences (among others) imply that some of the original Gang of Four (GoF) and Java patterns manifest themselves differently and some patterns don't apply at all. There are a few places in the book where the authors use the built-in events infrastructure and few other native features, but it's clear that they don't think in AS3. It seems like they think in Java.

For instance, the observer pattern is one of the core GoF and HeadFirst patterns. However, the native event capability in AS3 serves the same purpose. Rather than show you how/why to use the native event capability, this book happily shows you an AS3 translation of the GoF/HeadFirst observer pattern and never tells you to use the built-in event capability instead. In contrast, the Joey Lott and Danny Patterson book from Adobe Press, does not have a section on the observer pattern, but there is a chapter on "WORKING WITH EVENTS".

The above problem would be enough for me to recommend that you not buy this book but it gets worse. This book is not even great at teaching you how to think in design patterns. To be fair, neither is the original GoF design patterns book nor is the Lott/Patterson book. The best book for this purpose is the HeadFirst book. Its examples are Java but, the HeadFirst book walks you through application evolution which really makes the case for why the patterns are useful. The HeadFirst book also includes exercises and discussion as well as a quirky style that really make the concepts sink in so you learn to recognize when to use each pattern.

If you are an AS3 programmer who is already familiar with design patterns, just get the Lott/Patterson book. If you are new to design patterns, get the HeadFirst book AND the Lott/Patterson book.
Very clear book on Design Patterns for ActionScript developers - Review written on July 26, 2007
* * * * *
Rating: 5 out of 5
11 customers found this review helpful, 1 did not.

This book tackles the rather advanced topic of writing reusable OOP code for ActionScript 3.0 targeting intermediate ActionScript developers. The book organizes its topics in a way similar to the book "Design Patterns Elements of Reusable Object-Oriented Software" by Erich Gamma et al - also known as the Gang of Four. In spite of its target audience, the first part of the book contains an introduction to both design patterns and object orientation to assist those readers with minimal object-oriented programming experience. More advanced users may want to skip the review of OOP, but go over the materials on design patterns. Parts II, III and IV are the three major parts of the book. They examine fundamental design patterns, and organize the patterns into creational, structural and behavioral categories. Representative design patterns are included in each part, but every single design pattern from the book by Gamma and his associates is not included since these other patterns are not very relevant to ActionScript, plus Gamma's book is considered the definitive reference on the subject.

Each chapter on design patterns is organized in a similar matter both to clarify understanding the purpose of a design pattern and how to use it and to make the book more uniform and therefore well-suited as a reference. The following is the basic outline of each of the chapters on design patterns:

1. What is the pattern?
2. Key features of the pattern
3. The formal model of the pattern including a class diagram
4. Key OOP concepts found in the pattern
5. Minimalist abstract example
6. Applied examples

You will need either Flash CS3 or Flex 2 to work with the program examples in this book. All the applications were developed in Flash IDE, so Flex 2 developers will need to make modifications, especially where certain features were developed using Flash drawing tools and components. A few examples use Flash Media Server 2 (FMS2). Thoe examples can be created using the Developer's version of FMS2 that you can download from Adobe. You will need either a Windows or Linux OS to run Flash Media Server 2. Otherwise, you can skip the examples with FMS2 if you like and not lose much. The following is the detailed table of contents:

Part I. CONSTANT CHANGE
1. Object-Oriented Programming, Design Patterns, and ActionScript 3.0
The Pleasure of Doing Something Well
OOP Basics
Abstraction
Encapsulation
Inheritance
Polymorphism
Principles of Design Pattern Development
Program to Interfaces over Implementations
Favor Composition
Maintenance and Extensibility Planning
Your Application Plan: It Ain't You Babe
Part II. CREATIONAL PATTERNS
2. Factory Method Pattern
What Is the Factory Method Pattern?
Abstract Classes in ActionScript 3.0
Minimalist Example
Hiding the Product Classes
Example: Print Shop
Extended Example: Color Printing
Key OOP Concepts Used in the Factory Method Pattern
Example: Sprite Factory
Example: Vertical Shooter Game
Summary
3. Singleton Pattern
What Is the Singleton Pattern?
Key OOP Concepts Used with the Singleton Pattern
Minimalist Abstract Singleton
When to Use the Singleton Pattern
Summary
Part III. STRUCTURAL PATTERNS
4. Decorator Pattern
What Is the Decorator Pattern?
Key OOP Concepts Used with the Decorator Pattern
Minimalist Abstract Decorator
Applying a Simple Decorator Pattern in Flash: Paper Doll
Decorating - The right and wrong way
Dynamic Selection of Concrete Components and Decorations: A Hybrid Car Dealership
Summary
5. Adapter Pattern
What Is the Adapter Pattern?
Object and Class Adapters
Key OOP Concepts in the Adapter Pattern
Example: Car Steering Adapter
Extended Example: Steering the Car Using a Mouse
Example: List Display Adapter
Extended Example: Displaying the O'Reilly New Books List
Summary
6. Composite Pattern
What Is the Composite Pattern?
Minimalist Example of a Composite Pattern
Key OOP Concepts in the Composite Pattern
Example: Music Playlists
Example: Animating Composite Objects Using Inverse Kinematics
Using Flash's Built-in Composite Structure: the Display List
Summary
Part IV. BEHAVIORAL PATTERNS
7. Command Pattern
What Is the Command Pattern?
Minimalist Example of a Command Pattern
Key OOP Concepts in the Command Pattern
Minimalist Example: Macro Commands
Example: Number Manipulator
Extended Example: Sharing Command Objects
Extended Example: Implementing Undo
Example: Podcast Radio
Extended Example: Dynamic Command Object Assignment
Summary
8. Observer Pattern
What Is the Observer Pattern?
Key OOP Concepts Used with the Observer Pattern
Minimalist Abstract Observer
Example: Adding States and Identifying Users
Dynamically Changing States
Example: Working with Different Data Displays
Summary
9. Template Method Pattern
What Is the Template Method Pattern?
Key OOP Concepts Used with the Template Method
Minimalist Example: Abstract Template Method
Employing Flexibility in the Template Method
Selecting and Playing Sound and Video
Hooking It Up
Summary
10. State Pattern
Design Pattern to Create a State Machine
Key OOP Concepts Used with the State Pattern
Minimalist Abstract State Pattern
Video Player Concrete State Application
Expanding the State Design: Adding States
Adding More States and Streaming Capabilities
Summary
11. Strategy Pattern
What Is the Strategy Pattern?
Key OOP Concepts Used with the Strategy Pattern
Minimalist Abstract State Pattern
Adding More Concrete Strategies and Concrete Contexts
Working with String Strategies
Summary
Part V. MULTIPLE PATTERNS
12. Model-View-Controller Pattern
What Is the Model-View-Controller (MVC) Pattern?
Communication Between the MVC Elements
Embedded Patterns in the MVC
Minimalist Example of an MVC Pattern
Key OOP Concepts in the MVC Pattern
Example: Weather Maps
Extended Example: Infrared Weather Maps
Example: Cars
Custom Views
Adding a Chase Car
Summary
13. Symmetric Proxy Pattern
Simultaneous Game Moves and Outcomes
The Symmetric Proxy Pattern
Key OOP Concepts Used with the Symmetric Proxy
The Player Interface
The Referee
Information Shared Over the Internet
Player-Proxy Classes
Classes and Document Files Support
Summary
OOP and design patterns for actionscript 3 - Review written on July 24, 2007
* * * *
Rating: 4 out of 5
13 customers found this review helpful, 5 did not.

First, full disclosure; I have known Bill Sanders for many years and he is an honorary member of FlashCodersNY.org (he invited our group to read this title while it was in development). I've also had the pleasure to read both of the actionscript 3 design pattern titles currently available (Advanced ActionScript 3 with Design Patterns [Lott & Patterson] and ActionScript 3.0 Design Patterns: Object Oriented Programming Techniques [Sanders]).

Both books are a great resource. The difference is the depth that this book goes into. While the Lott book is slim and direct, every chapter in this book, has multiple examples to explain the concepts behind these sometime difficult to digest topics. Along with the OOP and patterns this book has some great ActionScript 3 code. This book can serve as a pattern reference and an ActionScript reference.

All of these ideas have been around for decades but this is one of the first books to convert so much of the design pattern library over to actionScript 3. Previously Flash devlopers had to learn their patterns from books written in Java. Bill Sanders has taken the pattern library and created Flash relevant examples. As ActionScript evolves a firm understanding of best practices and OOP is essential. Bill Sanders has written a fine book that is well worth buying.