Object-Oriented ActionScript 3.0
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

Object-Oriented ActionScript 3.0

on

  • 7,103 views

 

Statistics

Views

Total Views
7,103
Views on SlideShare
6,998
Embed Views
105

Actions

Likes
4
Downloads
202
Comments
3

8 Embeds 105

http://www.peterelst.com 32
https://learningedge.edgehill.ac.uk 20
https://learningedge.edgehill.ac.uk 20
http://www.flexden.net 18
http://www.slideshare.net 11
http://ddcpan.myvfs.ca 2
http://senastagesp4.blackboard.com 1
http://peterelst.com 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
  • Base class and super class are both the thing - i.e. the class that gets extended. The naming of the code example on slide 10 is confusing I agree.

    You could call the class that extends the 'child class'.
    Are you sure you want to
    Your message goes here
    Processing…
  • According to my knowledge BaseClass or superclass similar terms and i think here the author of this slide has created confusion by choosing wrong name.
    Ravi Bhadauria
    Are you sure you want to
    Your message goes here
    Processing…
  • i guess in slide 10 it should be BaseClass extends SuperClass, correct me if i am wrong
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Object-Oriented ActionScript 3.0 Presentation Transcript

  • 1. Object-Oriented ActionScript 3.0 Peter Elst 4th-6th June 2008 Edinburgh, Scotland
  • 2. Object-Oriented Programming ■ Difficult ■ Scary ■ Overhead ■ Only for large teams 4th-6th June 2008 Edinburgh, Scotland
  • 3. Object-Oriented Programming ■ Difficult? Structured code ■ Scary ■ Overhead ■ Only for large teams 4th-6th June 2008 Edinburgh, Scotland
  • 4. Object-Oriented Programming ■ Difficult? Structured code ■ Scary? Initial learning curve ■ Overhead ■ Only for large teams 4th-6th June 2008 Edinburgh, Scotland
  • 5. Object-Oriented Programming ■ Difficult? Structured code ■ Scary? Initial learning curve ■ Overhead? Promotes code reuse ■ Only for large teams 4th-6th June 2008 Edinburgh, Scotland
  • 6. Object-Oriented Programming ■ Difficult? Structured code ■ Scary? Initial learning curve ■ Overhead? Promotes code reuse ■ Only for large teams? Useful for anyone 4th-6th June 2008 Edinburgh, Scotland
  • 7. Classes (the artist formerly known as prototype) ■ The way things were: function Conference() { this.name = quot;Flashforwardquot;; } Conference.prototype.getName = function() { trace(quot;conference name: quot;+this.name); } var myConference = new Conference(); myConference.getName(); 4th-6th June 2008 Edinburgh, Scotland
  • 8. Classes (the artist formerly known as prototype) ■ The way things are: package { public class Conference { public var name:String = quot;Flashforwardquot;; public function getName():void { trace(quot;conference name: quot;+this.name); } } } 4th-6th June 2008 Edinburgh, Scotland
  • 9. Instances ■ Classes provide a blueprint ■ Instances set their values for properties 4th-6th June 2008 Edinburgh, Scotland
  • 10. Inheritance (getting rich the easy way) ■ Classes can extend each-other ■ Avoids code duplication ■ Properties and methods can be overridden package { public class SuperClass extends BaseClass { public function SuperClass() { super(); } } } 4th-6th June 2008 Edinburgh, Scotland
  • 11. Inheritance vs composition ■ Inheritance deals with an is a relationship ■ Composition is used for has a relationships Employee is a Person Employee has a Job 4th-6th June 2008 Edinburgh, Scotland
  • 12. Encapsulation (don't touch my stuff) ■ Protect the inner workings of your code through the use of access modifiers ■ Provide an API for other classes to use by providing getter/setter methods public - anything can access this private - only the class itself can access protected - class and its subclasses can access internal (default) - all classes in the same class package 4th-6th June 2008 Edinburgh, Scotland
  • 13. Polymorphism (copycat behavior) ■ Have classes use the same method names ■ Allows classes to be swapped at runtime ■ Same name but different implementation Doctor.work() Fireman.work() WebDeveloper.work() 4th-6th June 2008 Edinburgh, Scotland
  • 14. Interfaces (sign on the dotted line) ■ Classes can use one or more interfaces ■ Interfaces require a class to implement a specific set of methods ■ Used to formalize polymorphism ■ Interfaces can extend each-other 4th-6th June 2008 Edinburgh, Scotland
  • 15. Design Patterns General solutions to common problems 4th-6th June 2008 Edinburgh, Scotland
  • 16. Observer pattern ■ Problem: notify other classes when an update occurs in a data model ■ Solution: keep an array of all instances that want to be notified and call their update method then the model has changed 4th-6th June 2008 Edinburgh, Scotland
  • 17. Singleton pattern ■ Problem: allow only one instance of a class to exist in an application ■ Solution: prevent the constructor from being called outside of the class scope and provide a static method for returning the single class instance 4th-6th June 2008 Edinburgh, Scotland
  • 18. Want to learn more? Books ■ Object-Oriented ActionScript 3.0 ■ Essential ActionScript 3.0 Course ■ Core ActionScript 3.0 (Skills Matter - London) 4th-6th June 2008 Edinburgh, Scotland
  • 19. Thanks! 4th-6th June 2008 Edinburgh, Scotland
  • 20. Get in touch! Peter Elst Flash Platform Consultant Blog: www.peterelst.com Email: training@peterelst.com LinkedIn: www.linkedin.com/in/peterelst Twitter: www.twitter.com/peterelst 4th-6th June 2008 Edinburgh, Scotland