My study of “Essential Actionscript 3.0 ” continues…
1. no inheritence
2. no override
3. executes faster ( future version of flash player may execute “final” and “non-final” methods at same speed )
4. hides a class’s internal detail
Note : There is a major opinion difference exists, between developers, whether to make things “final” or not on the basis of basic OOP priniciple.
[OOP says : An instance of a subclass can be used anywhere an instance of its super class is expected.]
Relationships : is-A, has-A, uses-A
Composition is favoured over Inheritence as an application design strategy.
1.Changing code that uses composition has fewer consequences than changing code that uses inheritence.
want to use service of another class : use composition
2. Code based on inheritence often executes faster than code based on composition.
want to use polymorphism : consider inheritence
DataType : Automatic runtime-conversion is known as “coercion” (conversion).
as : “Date” and “Array” type casting is done with “as” operator ( myVar as Array; ) rather than usual type casting like “dataType(Expression);”
is : “is” is used to check the datatype of an Object. ( if( msg is String ) )
“Null” and “void” are data types
“null” and “undefined” are values
“void” data type objects has got one and only value “undefined”.
“Null” data type objects has got one and only value “null”.
“null” value represents the absence of data with a specified type annotation set to anything but Boolean,int,uint,Number.
“undefined” value represents the absence of data without a specified type annotation. “undefined” value also represents the complete absence of a variable or method on an object whose class is defined as “dynamic”.