I was about to say whats this [mixin] business then? Havent seen any
documentation about this.

 

Michael when can we see some demo components on your blog? 

 

Sounds like your pretty close.

 

Cool

 

Campbell A.

 

   _____  

From: Michael Schmalle [mailto:[EMAIL PROTECTED] 
Sent: Friday, January 12, 2007 1:38 PM
To: [email protected]
Subject: Re: [flexcomponents] Singleton :: Where to register with classMap

 

Thanks!

That did the trick.

Is Mxin documented anywhere? I don't remember seeing docs for that, I see it
in the framework.

Thanks again, Mike

On 1/11/07, Alex Harui <HYPERLINK
"mailto:[EMAIL PROTECTED]"[EMAIL PROTECTED]> wrote:

A good question.  I would put it in MoveManagerImpl.  Try using [mixin] on
the class an implementing the init() method.

 

[Mixin]

/**

 …

 */

public class MoveManagerImpl… 

{

 

            /**

             *  Mixin callback 

             */

            public static function init(root:DisplayOb-ject):void

            {

Singleton.registerC-lass("com.teotiGraphix.-managers.-moveManagerClass-es::I
UIMoveManag-er ", MoveManagerImpl)-;
}

 

   _____  

From: HYPERLINK
"mailto:[email protected]"[EMAIL PROTECTED]
[mailto:HYPERLINK "mailto:flexcompone"; \nflexcomponeHYPERLINK
"mailto:[EMAIL PROTECTED]" [EMAIL PROTECTED] On Behalf Of Michael
Schmalle
Sent: Thursday, January 11, 2007 2:10 PM
To: HYPERLINK
"mailto:[email protected]"[EMAIL PROTECTED]
Subject: Re: [flexcomponents] Singleton :: Where to register with classMap

 

Wow Alex,

Thanks for the quick response. 

After actually thinking a bit, the interface answer seems obvious now. :)

So say I am creating a move manager that developer will use. Now my question
is more direct. 

Where should I put the register method? 

I have MoveManagerFX static class; This class indirectly implements the
IUIMoveManager interface through static methods.

   private static var implClassDependency-:MoveManagerImpl-; 

    private static var impl:IUIMoveManager =
 
Singleton.getInstan-ce("com.teotiGraphix.-managers.-moveManagerClass-es::IUI
MoveManag-er") as IUIMoveManager;

Then in the MoveManagerImpl; this class directly implements the
IUIMoveManager interface through public methods. 

    /**
     * The single instance of the <code>MoveManagerImpl </code>.
     * @private
     */
    private static var instance:MoveManage-rImpl = null;
    
    /**
     * Returns the single instance of the <code>MoveManagerImpl </code>. 
     * 
     * @return Returns the single instance of the <code>MoveManagerImpl
</code>
     * instance.
     */
    public static function getInstance(-):IUIMoveManager
    {
        if (instance == null) 
            instance = new MoveManagerImpl(-);
        return instance;
    }

With these two classes, where I am going to put this line;


Singleton.registerC-lass("com.teotiGraphix.-managers.-moveManagerClass-es::I
UIMoveManag-er ", MoveManagerImpl)-;


Am I conceptualizing this wrong?

Thanks, Mike

On 1/11/07, Alex Harui <HYPERLINK "mailto:[EMAIL PROTECTED]" \n
[EMAIL PROTECTED]> wrote:

You can register anytime before you need to ask for the singleton.  Since
our managers get used early in startup, we register them as early as
possible.  You might be able to wait longer, even as late as
creationComplete.  In some apps, the popup manager is loaded in a module
that is loaded way after the app started.

 

We register interfaces instead of classes for version control.  If a module
in an application requires an older version of the framework, it will live
in its own application domain and thus not share the same singleton as the
main app.  What we promise is that the interfaces will never change, and the
interfaces are put in a bootstrap app domain.  Then when you ask for the
singleton, you can share it across app domains.

 

-Alex

 

   _____  

From: HYPERLINK "mailto:[email protected]";
[EMAIL PROTECTED] [mailto:HYPERLINK "mailto:flexcompone";
\nflexcomponeHYPERLINK "mailto:[EMAIL PROTECTED]" \n [EMAIL PROTECTED]
On Behalf Of Michael Schmalle
Sent: Thursday, January 11, 2007 1:38 PM
To: HYPERLINK "mailto:[email protected]";
[EMAIL PROTECTED]
Subject: [flexcomponents] Singleton :: Where to register with classMap

 

Hi,

I have managers I am implementing singletons with.

I am trying to stick to the singleton pattern. I see that yor singletons are
registered in the systemManager frame 2 handler.

I also see that you are not using registerInitCallbac-ks() anymore. 

So the question is... Where do I put my line of code that registers the
implementation class with the Singleton class map?

IE you have

Singleton.registerC-lass("mx.managers:-:ICursorManager ",
Class(getDefinition-ByName("mx.managers:-:CursorManagerIm-pl")));

I want

Singleton.registerC-lass("com.teotiGraphix.-manager::-IMoveManager",
Class(getDefinition-ByName("com.teotiGraphix.-manager::-MoveMangerImpl ")));

Also, why do you use the interface name when registering the class, is that
so others can override you implementation? (with the same register call)...
This is the first time I actually thought about it this way. ;-) 

Peace, Mike

PS I have been kind holding back on releasing components thus far because I
wanted my managers piped into this new algorithm.


-- 
Teoti Graphix
HYPERLINK "http://www.teotigraphix.com"; \nhttp://www.teotigra-phix.com

Blog - Flex2Components
HYPERLINK "http://www.flex2components.com"; \nhttp://www.flex2com-ponents.com

You can find more by solving the problem then by 'asking the question'. 




-- 
Teoti Graphix
HYPERLINK "http://www.teotigraphix.com"; \nhttp://www.teotigra-phix.com

Blog - Flex2Components
HYPERLINK "http://www.flex2components.com"; \nhttp://www.flex2com-ponents.com


You can find more by solving the problem then by 'asking the question'. 




-- 
Teoti Graphix
HYPERLINK "http://www.teotigraphix.com"http://www.teotigra-phix.com

Blog - Flex2Components
HYPERLINK "http://www.flex2components.com"http://www.flex2com-ponents.com 

You can find more by solving the problem then by 'asking the question'. 

 


--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.16.9/623 - Release Date: 1/11/2007
3:33 PM



-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.16.9/623 - Release Date: 1/11/2007
3:33 PM
 

Reply via email to