The big difference is that singleton classes have an instance. By having an 
instance, the singleton class can inherited functionality as well as 
subclasses. There are many more benefits...but it really comes down to how 
you're using it. If you don't need inherited functionality, static classes are 
fine.

Scott

-----Original Message-----
From:   [EMAIL PROTECTED] on behalf of Judah
Sent:   Mon 2/20/2006 1:22 PM
To:     'Flashcoders mailing list'
Cc:     
Subject:        RE: [Flashcoders] Re: When singletons go bad


Slightly off the subject but why does he have to use getInstance()?
Isn't there a way to use a singleton without calling getInstance? Why can't
he directly use the class like this:

import MyManager;

MyManager.doSomething();

The Math class, Delegate class and other classes let you use methods without
calling getInstance() first. 

Judah

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Jack Doyle
Sent: Monday, February 20, 2006 11:53 AM
To: [email protected]
Subject: [Flashcoders] Re: When singletons go bad

Just curious if this works better for you:

private function MyManager() {
         // constructor
         return getInstance();
}

public static function getInstance() : MyManager{
         if(_myManager == undefined){
                 _myManager = new MyManager();
                 _myManager.init();
         }
         return _myManager;
}

Sorry, I haven't had the time to follow the whole discussion, but I figured
I'd throw this your way and see if it helps. 

Good luck.

Jack



_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com



_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to