Matt -

Would subclassing really be an issue?  presumably, the subclass would have 
a different name than the super class, so it wont really be a method 
override, or am i looking at it too simplistically?

At 12:24 PM 10/26/2005, you wrote:
>The Player team is still thinking about it.  We all want private 
>constructors, but we may not get them for this release and will instead 
>need to rely on the kludge like you mentioned.  The consequences of the 
>private constructor are not obvious but they are there (for example the 
>inability to subclass since you can’t create another public/protected 
>constructor since we don’t get overloading; fine for a singleton, maybe 
>not fine in the general case)…
>
>
>----------
>From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On 
>Behalf Of Spike
>Sent: Wednesday, October 26, 2005 8:34 AM
>To: flexcoders@yahoogroups.com
>Subject: Re: [flexcoders] Implementing ModelLocator pattern in AS3/Flex2
>
>I agree that it's a bit of a kludge, but it does provide a reliable way to 
>implement the Singleton pattern.
>
>With a bit of luck MM will add private constructors to the language before 
>the final release and we won't have to worry about it.
>
>My guess is that there are a couple of internal things that rely on there 
>being a public constructor and that it will get added later.
>
>Spike
>On 10/26/05, Battershall, Jeff 
><<mailto:[EMAIL PROTECTED]>[EMAIL PROTECTED]> wrote:
>Spike,
>
>Thanks!  Why should we have to do such a kludgy workaround, though?  Why 
>can't we have a private constructor if Java does? Suppose that's a 
>question for the Flash Player engineering team...
>
>Jeff
>-----Original Message-----
>From: <mailto:flexcoders@yahoogroups.com>flexcoders@yahoogroups.com 
>[mailto: [EMAIL PROTECTED] On Behalf Of Spike
>Sent: Wednesday, October 26, 2005 11:16 AM
>To: <mailto:flexcoders@yahoogroups.com>flexcoders@yahoogroups.com
>Subject: Re: [flexcoders] Implementing ModelLocator pattern in AS3/Flex2
>
>
>Yeah, my bad,
>
>I wrote that in the email editor and didn't test it, but hopefully it 
>demonstrates the idea.
>
>Spike
>On 10/26/05, Battershall, Jeff 
><<mailto:[EMAIL PROTECTED]>[EMAIL PROTECTED] > wrote:
>Hmmmm....shouldn't the private var 'instance' also be static?
>
>Jeff
>-----Original Message-----
>From: <mailto:flexcoders@yahoogroups.com>flexcoders@yahoogroups.com 
>[mailto: [EMAIL PROTECTED] On Behalf Of Spike
>Sent: Wednesday, October 26, 2005 10:50 AM
>To: <mailto:flexcoders@yahoogroups.com>flexcoders@yahoogroups.com
>Subject: Re: [flexcoders] Implementing ModelLocator pattern in AS3/Flex2
>package {
>   public class MySingleton {
>
>     private var instance:MySingleton;
>
>     public MySingleton(x:PrivateClass) {
>       instance = this;
>     }
>
>     public static getInstance():MySingleton {
>       if (instance == null) {
>         instance = new MySingleton(new PrivateClass());
>       }
>       return instance;
>     }
>   }
>
>   private class PrivateClass {
>
>   }
>}
>
>Something like that.
>
>Spike
>
>On 10/26/05, Battershall, Jeff <<mailto:[EMAIL PROTECTED]> 
>[EMAIL PROTECTED] > wrote:
>I've been playing with this a bit and my big, big question is this:  How 
>the heck can you create a singleton when the contructor evidently must be 
>public in AS 3.0?
>
>Jeff Battershall
>Application Architect
>Dow Jones Indexes
><mailto:[EMAIL PROTECTED]>[EMAIL PROTECTED]
>(609) 520-5637 (p)
>(484) 477-9900 (c)
>-----Original Message-----
>From: <mailto:flexcoders@yahoogroups.com>flexcoders@yahoogroups.com 
>[mailto: [EMAIL PROTECTED] On Behalf Of Benoit Hediard
>Sent: Tuesday, October 25, 2005 9:48 AM
>To: <mailto:flexcoders@yahoogroups.com>flexcoders@yahoogroups.com
>Subject: RE: [flexcoders] Implementing ModelLocator pattern in AS3/Flex2
>I don't think that bindings works on singleton instance syntax.
>
>TestLocator.as
>---------------------
>package {
>
>  public class TestLocator {
>
>   private static var testLocator:TestLocator;
>
>   public var someProperty:String;
>
>   public static function getInstance():TestLocator {
>    if(testLocator == null)
>     testLocator = new TestLocator();
>
>    return testLocator;
>     }
>
>   public function TestLocator() {
>    this.someProperty = "Some value";
>   }
>
>  }
>}
>
>Test.mxml
>-----------------
><?xml version="1.0" ?>
><mx:Application xmlns:mx="<http://www.macromedia.com/2005/mxml> 
>http://www.macromedia.com/2005/mxml"; xmlns="*">
>
><mx:Script>
>  <![CDATA[
>   import TestLocator;
>
>   private function onChangeClick():Void {
>    TestLocator.getInstance().someProperty = 'Some other value';
>   }
>  ]]>
></mx:Script>
>
><mx:Label text="{TestLocator.getInstance().someProperty}" />
>
><mx:Button label="Change value" click="onChangeClick()" />
>
></mx:Application>
>
>Anyway, I'll wait for the release of Cairngorm for Flex2.0 to see how 
>Steven and Allistair did this part of their framework.
>
>Thanks.
>
>Benoit Hediard
>
>
>----------
>De : <mailto:flexcoders@yahoogroups.com>flexcoders@yahoogroups.com 
>[mailto: [EMAIL PROTECTED] De la part de Matt Chotin
>Envoyé : lundi 24 octobre 2005 19:39
>À : <mailto:flexcoders@yahoogroups.com>flexcoders@yahoogroups.com
>Objet : RE: [flexcoders] Implementing ModelLocator pattern in AS3/Flex2
>
>I haven't investigated this for real but you may need to turn ModelLocator 
>into a singleton so that there's an instance of an object to 
>watch.  Because we're doing code-gen and not prototype hacking it's 
>impossible to make a Class object an EventDispatcher.  The singleton 
>approach would allow us to use the code-gen and then you'd simply bind to 
>ModelLocator.getInstance().myModel instead of ModelLocator.myModel.
>
>
>
>Matt
>
>
>
>----------
>From: <mailto:flexcoders@yahoogroups.com>flexcoders@yahoogroups.com 
>[mailto: [EMAIL PROTECTED] On Behalf Of Clint Modien
>Sent: Friday, October 21, 2005 12:18 PM
>To: <mailto:flexcoders@yahoogroups.com>flexcoders@yahoogroups.com
>Subject: Re: [flexcoders] Implementing ModelLocator pattern in AS3/Flex2
>
>
>
>Make the objects in the Model Locator typed.... by importing the classes 
>you need to ref.
>
>On 10/21/05, Benoit Hediard <<mailto:[EMAIL PROTECTED]> [EMAIL PROTECTED]> 
>wrote:
>
>Since it is not possible to create bindings to static properties, how do 
>you implement the ModelLocator pattern in AS3?
>
>
>
>Benoit Hediard
>
>
>
>PS: by the way, any information on an alpha release of Cairngorm for Flex2.0?
>
>
>
>--
>Flexcoders Mailing List
>FAQ: 
><http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt>http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
>Search Archives: 
><http://www.mail-archive.com/flexcoders%40yahoogroups.com>http://www.mail-archive.com/flexcoders%40yahoogroups.com
> 
>
>
>----------
>YAHOO! GROUPS LINKS
>
>
>  Visit your group "<http://groups.yahoo.com/group/flexcoders> flexcoders" 
> on the web.
>
>  To unsubscribe from this group, send an email to:
>  <mailto:[EMAIL PROTECTED]> 
> [EMAIL PROTECTED]
>
>  Your use of Yahoo! Groups is subject to the 
> <http://docs.yahoo.com/info/terms/>Yahoo! Terms of Service.
>
>
>----------
>
>
>
>--
>Flexcoders Mailing List
>FAQ: 
><http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt>http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> 
>
>Search Archives: 
><http://www.mail-archive.com/flexcoders%40yahoogroups.com>http://www.mail-archive.com/flexcoders%40yahoogroups.com
> 
>
>
>
>----------
>YAHOO! GROUPS LINKS
>
>  Visit your group "<http://groups.yahoo.com/group/flexcoders>flexcoders" 
> on the web.
>
>  To unsubscribe from this group, send an email to:
>  <mailto:[EMAIL PROTECTED]> 
> [EMAIL PROTECTED]
>
>  Your use of Yahoo! Groups is subject to the 
> <http://docs.yahoo.com/info/terms/>Yahoo! Terms of Service.
>
>
>----------
>
>
>
>--
>--------------------------------------------
>Stephen Milligan
>Do you do the Badger?
><http://www.yellowbadger.com>http://www.yellowbadger.com
>
>Do you cfeclipse? <http://www.cfeclipse.org>http://www.cfeclipse.org
>
>
>--
>Flexcoders Mailing List
>FAQ: 
><http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt>http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
>Search Archives: 
><http://www.mail-archive.com/flexcoders%40yahoogroups.com>http://www.mail-archive.com/flexcoders%40yahoogroups.com
> 
>
>
>
>SPONSORED LINKS
><http://groups.yahoo.com/gads?t=ms&k=Web+site+design+development&w1=Web+site+design+development&w2=Computer+software+development&w3=Software+design+and+development&w4=Macromedia+flex&w5=Software+development+best+practice&c=5&s=166&.sig=L-4QTvxB_quFDtMyhrQaHQ>Web
> 
>site design development
><http://groups.yahoo.com/gads?t=ms&k=Computer+software+development&w1=Web+site+design+development&w2=Computer+software+development&w3=Software+design+and+development&w4=Macromedia+flex&w5=Software+development+best+practice&c=5&s=166&.sig=lvQjSRfQDfWudJSe1lLjHw>Computer
> 
>software development
><http://groups.yahoo.com/gads?t=ms&k=Software+design+and+development&w1=Web+site+design+development&w2=Computer+software+development&w3=Software+design+and+development&w4=Macromedia+flex&w5=Software+development+best+practice&c=5&s=166&.sig=1pMBCdo3DsJbuU9AEmO1oQ>Software
> 
>design and development
><http://groups.yahoo.com/gads?t=ms&k=Macromedia+flex&w1=Web+site+design+development&w2=Computer+software+development&w3=Software+design+and+development&w4=Macromedia+flex&w5=Software+development+best+practice&c=5&s=166&.sig=OO6nPIrz7_EpZI36cYzBjw>Macromedia
> 
>flex
><http://groups.yahoo.com/gads?t=ms&k=Software+development+best+practice&w1=Web+site+design+development&w2=Computer+software+development&w3=Software+design+and+development&w4=Macromedia+flex&w5=Software+development+best+practice&c=5&s=166&.sig=f89quyyulIDsnABLD6IXIw>Software
> 
>development best practice
>
>
>
>----------
>YAHOO! GROUPS LINKS
>
>  Visit your group "<http://groups.yahoo.com/group/flexcoders>flexcoders" 
> on the web.
>
>  To unsubscribe from this group, send an email to:
>  <mailto:[EMAIL PROTECTED]> 
> [EMAIL PROTECTED]
>
>  Your use of Yahoo! Groups is subject to the 
> <http://docs.yahoo.com/info/terms/>Yahoo! Terms of Service.
>
>
>----------
>
>
>
>--
>--------------------------------------------
>Stephen Milligan
>Do you do the Badger?
><http://www.yellowbadger.com>http://www.yellowbadger.com
>
>Do you cfeclipse? <http://www.cfeclipse.org>http://www.cfeclipse.org
>
>
>
>--
>Flexcoders Mailing List
>FAQ: 
><http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt>http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
>Search Archives: 
><http://www.mail-archive.com/flexcoders%40yahoogroups.com>http://www.mail-archive.com/flexcoders%40yahoogroups.com
> 
>
>
>
>SPONSORED LINKS
><http://groups.yahoo.com/gads?t=ms&k=Web+site+design+development&w1=Web+site+design+development&w2=Computer+software+development&w3=Software+design+and+development&w4=Macromedia+flex&w5=Software+development+best+practice&c=5&s=166&.sig=L-4QTvxB_quFDtMyhrQaHQ>Web
> 
>site design development
><http://groups.yahoo.com/gads?t=ms&k=Computer+software+development&w1=Web+site+design+development&w2=Computer+software+development&w3=Software+design+and+development&w4=Macromedia+flex&w5=Software+development+best+practice&c=5&s=166&.sig=lvQjSRfQDfWudJSe1lLjHw>Computer
> 
>software development
><http://groups.yahoo.com/gads?t=ms&k=Software+design+and+development&w1=Web+site+design+development&w2=Computer+software+development&w3=Software+design+and+development&w4=Macromedia+flex&w5=Software+development+best+practice&c=5&s=166&.sig=1pMBCdo3DsJbuU9AEmO1oQ>Software
> 
>design and development
><http://groups.yahoo.com/gads?t=ms&k=Macromedia+flex&w1=Web+site+design+development&w2=Computer+software+development&w3=Software+design+and+development&w4=Macromedia+flex&w5=Software+development+best+practice&c=5&s=166&.sig=OO6nPIrz7_EpZI36cYzBjw>Macromedia
> 
>flex
><http://groups.yahoo.com/gads?t=ms&k=Software+development+best+practice&w1=Web+site+design+development&w2=Computer+software+development&w3=Software+design+and+development&w4=Macromedia+flex&w5=Software+development+best+practice&c=5&s=166&.sig=f89quyyulIDsnABLD6IXIw>Software
> 
>development best practice
>
>
>
>----------
>YAHOO! GROUPS LINKS
>
>  Visit your group "<http://groups.yahoo.com/group/flexcoders>flexcoders" 
> on the web.
>
>  To unsubscribe from this group, send an email to:
>  <mailto:[EMAIL PROTECTED]> 
> [EMAIL PROTECTED]
>
>  Your use of Yahoo! Groups is subject to the 
> <http://docs.yahoo.com/info/terms/>Yahoo! Terms of Service.
>
>
>----------
>
>
>
>--
>--------------------------------------------
>Stephen Milligan
>Do you do the Badger?
><http://www.yellowbadger.com>http://www.yellowbadger.com
>
>Do you cfeclipse? <http://www.cfeclipse.org>http://www.cfeclipse.org
>
>
>
>
>--
>Flexcoders Mailing List
>FAQ: 
><http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt>http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
>Search Archives: 
><http://www.mail-archive.com/flexcoders%40yahoogroups.com>http://www.mail-archive.com/flexcoders%40yahoogroups.com
> 
>
>
>
>
>----------
>YAHOO! GROUPS LINKS
>
>    *  Visit your group 
> "<http://groups.yahoo.com/group/flexcoders>flexcoders" on the web.
>    *
>    *  To unsubscribe from this group, send an email to:
>    * 
> <mailto:[EMAIL PROTECTED]>[EMAIL PROTECTED] 
>
>    *
>    *  Your use of Yahoo! Groups is subject to the 
> <http://docs.yahoo.com/info/terms/>Yahoo! Terms of Service.
>
>
>----------



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/nhFolB/TM
--------------------------------------------------------------------~-> 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to