AS3 does not miss a function, and you cannot define it as "less developed."
Firstly, for your problem - there are ways related to the methodology of the abstract class. For your abstract Character class - you can make the user developer get an error when trying to create an instance.
package com.strangemother.database.abstract { public class CentralDispatch extends EventDispatcher { private static var _centralDispatch:CentralDispatch; public static function getInstance():CentralDispatch { if(!_centralDispatch) _centralDispatch = new CentralDispatch(SingletonLock); return _centralDispatch; } public function CentralDispatch(lock:Class) { if(!lock is SingletonLock) { throw new Error("CentralDispatch is a singleton. Use CentralDispatch.getInstance() to use."); } } } } internal class SingletonLock{}
As you can see, this should be used by the ".getInstance" method, but to extend this, only this class can create a new instance of itself, since its the only class that can see the inner class SingletonLock {} ". For your purpose, you can remove the getInstance () method and force another way to get an instance of this class.
This should also reflect the ability to create inner classes. They cannot be noticed by any other class - only this package and the parent class CentralDispatch can use it.
Another way to use the abstract function method is to then write to interface
package com.strangemother.database.engines { import com.strangemother.database.Model; import com.strangemother.database.ModelSchema; import com.strangemother.database.events.ModelEvent; public interface IEngine { function generateModelSchema(modelSchema:ModelSchema=null):String function generateModel(model:Model):String } }
then at any time to use this, you implement it at the class level
public class SQLite3 extends EngineBase implements IEngine {
now my SQLite3 class should have methods defined in IEngine
I prefer to write classes with specific functions that are overridden during implementation.
AbstractBase.as
public function connect(onComplete:Function=null):void {
SQLite3 from which extends AbstractionBase at some point
overide public function connect(onComplete:Function=null):void
Now refute @Allan's comment that it is less developed (sorry, dude)
No operator overloading - this is correct, but not Java. It has not been used to ensure readability of AS3.
Function overloading - you cannot type it hard, but you can have function makeTea(...args) , passing as much or as little data as possible. you also have getters / setters.
for built-in functions, you can create anonymous functions.
var myFunction:Function = Function(name:String):String{ return name + ' - rocks!'; }
You have dynamic classes, so class level overloading is
and a good example of real code is Flex Lib, which is open source, and you can read how all these elements are controlled by flashing through the code.