Added a note about singleton classes.
I'm just whinging, really. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3997 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -328,3 +328,22 @@ ActionScript
|
||||
- add code to verify the object's functions against describeType calls..
|
||||
(would need to iterate on types because describeType only finds methods
|
||||
in the terminal interface. Only # of args can be checked)
|
||||
|
||||
- Private constructors are not allowed, so the official line from Macromedia
|
||||
on creating Singleton classes, I-shit-you-not, is to do this:
|
||||
|
||||
package foo {
|
||||
|
||||
public class Singleton
|
||||
{
|
||||
public static const singleton :Singleton = new Singleton(new SecretClass());
|
||||
|
||||
public function Singleton (secret :SecretClass)
|
||||
{
|
||||
}
|
||||
}
|
||||
} // end: package
|
||||
|
||||
public class SecretClass // inaccessible outside this file
|
||||
{
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user