actionscript 3 - Actionscript3 difference between singleton and static -


in as3 have seen alot of people creating singleton classes using internal class n getinstance.

i know whats basic difference in singleton , keeping public functions/vars static???

singleton in as3

  • can implement interface. (power of polymorphism)

  • you can inherit or extend other class.

  • can passed parameter other method.

  • its methods can passed parameters other methods. (almost unique)

  • lazy instantiation support *

  • one instance, this keyword *

static in as3

  • simple reach

  • no instance, no this keyword *


*updated/added due meaningful comments


Comments

Popular posts from this blog

php - get table cell data from and place a copy in another table -

javascript - Mootools wait with Fx.Morph start -

php - Navigate throught databse rows -