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:
Ray Greenwell
2006-04-04 17:35:10 +00:00
parent aec7a1ece2
commit 492bde538f
+19
View File
@@ -328,3 +328,22 @@ ActionScript
- add code to verify the object's functions against describeType calls.. - add code to verify the object's functions against describeType calls..
(would need to iterate on types because describeType only finds methods (would need to iterate on types because describeType only finds methods
in the terminal interface. Only # of args can be checked) 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
{
}