ActionScript 3.0 Design Patterns

(Chris Devlin) #1
Abstraction | 11

understanding of OOP’s many nuances. We ourselves were surprised at how differ-


ent design patterns brought out different perspectives on the same OOP concept and


helped further clarify it.


To get started, we’ll review the four basic OOP concepts:



  • Abstraction

  • Encapsulation

  • Inheritance

  • Polymorphism


Each of these concepts needs reflection, and if you’re new to OOP, don’t worry


about getting it right the first time. We go over these concepts time and again in the


design pattern chapters.


Abstraction


In general, an abstraction is a model or ideal. You don’t have all of the details, but


you have the general parameters that can be filled in with details. Further, an


abstraction is clear enough for you to tell one abstraction from another. Take, for


example, two jobs your company is trying to fill. One’s for a Web designer and the


other’s for a programmer. To advertise for the position, you would not describe the


person as a specific person but instead in terms of the characteristics you want for


the position. You might have the two abstractions representing the two different


positions:


Two Positions Open:



  • Programmer


— Experienced with multi-programmer projects
— Experienced with middleware and database programming

— ECMAScript programming background
— OOP and Design Pattern programming skills


  • Web designer
    — Experienced with creating Web graphics


— Familiar with animation graphics
— Can work with vector graphics

— Client-centered approach


You can tell the difference between the two positions and their general requirements


(properties), but the details are left fairly open. A programmer is unlikely to apply for


the Web designer position and a designer is just as unlikely to apply for the


programmer position. However, a pool of applicants could have a wide range of

Free download pdf