Mar
28
2003

ff2003: oop, design patterns and application development

current session: “OOP, Design Patterns and Application Development”

David Yang, Quantumwave Interactive.

Design patterns are time-tested solutions to common software design problems and are important for rapid application development. This session will explore some of the essential patterns in building rich media Internet applications, from both the client and server-side perspectives. By applying common object-oriented programming methodologies, this session will investigate different patterns and their implementations, with applications using Flash Remoting, ColdFusion MX, and the Flash Communication Server. A basic understanding of Object Oriented Programming is assumed.

Note: This entry is being posted after the fact. I took notes during the session, but didn’t have a chance to write it up in narrative format until Monday, March 31.

I’ll say right off that this session was completely over my head. I’ve heard lots of gripes on the Flashcoders mailing list about limitations in ActionScript with respect to other programming languages (i.e. inheritance, public/private classes, etc.). Most of those gripes have gone over my head, too, given that I don’t have a very high-end programming background.

This presentation offered a very quick introduction to object-oriented programming, and addressed some of those gripes voiced in Flashcoders.

I will say that I appreciated the “geek” references in Yang’s code.

new AllianceCommander(“Yoda”,”The Force”,42);

OOP concepts

- Object

- Data (properties)

- Methods (functions to act on the data)

- Encapsulation (self-contained, data hiding)

- Responsiveness

- Class, constructor, instance

- Private, protected, static

- Inheritance, super class, sub class, composition

- Polymorphism, overriding, overloading

- Process: requirement analysis (OOA), design (OOD), implementation, refactoring

What is OOP about?

- About objects, not data.

- About what each object can do.

- Don’t ask an object for info so you can do something with it. Ask the object to do it for you.

- All objects must provide their own interface.

- All data should be private.

OOP in Flash

- ActionScript is a prototype-based language.

- Class is implenmted as functions.

- Objects are placed in the proto chain.

- Root of the chain is Object (the base class).

- Inheritance through the proto.

- No true private variables/properties.

UML (Unified Modeling Language)

- Visual modeling language.

- Creates relational diagrams/representations of an application or system.

- Use case diagrams, activity diagrams, interaction diagrams, sequence diagrams, class diagrams, state diagrams, deployment diagrams.

Design patterns

- Patterns are recurring solutions for identifying and solving problems in context.

- When there are problems, there are usually patterns already identified from others’ experiences.

- Examples: Architecture, engineering, gaming, personal relationships, business operations, software development.

Software design patterns

- Useful for communicating reusable solutions to problems.

- Language independent.

- A pattern has: name, intent, problem, solution, participants and collaborators, consequences and implementation (not code).

- Sorted into different categories: design, creational, architectural, idioms.

Common patterns & frameworks: Abstract Factory, Adapter, Decorator, Facade, MVC (Model View Controller), MVP (Model View Presenter), Observer, PAC (Presentation Abstraction Control, Proxy, Singleton, Strategy.

“Facade” pattern

- Problem: Complex system interface.

- Intent: Simplify the interface.

- Solution: Create a new interface for the client.

- Consequences: Simplifies the use of the subsystem. Certain functionalities may not be available.

- Implementation: New interface to the system.

Post a comment

As a spam-control measure, your comment may require my approval before it will appear on the entry. Thanks for waiting. To avoid the moderation delay, consider filling in your e-mail address. It won't appear on the site, but I use it to whitelist frequent commenters so their comments appear automatically.


The following HTML tags are permitted (if you want to use them):
p, br, a href, b, strong, u, i, em, ol, ul, li, cite, blockquote