Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Show Posts

* | |

  Show Posts
Pages: 1 ... 4 5 [6]
76  PureMVC Manifold / Demos and Utils / Re: StateMachine - A PureMVC / AS3 Utility on: March 04, 2009, 07:41:28
Hey Cliff


After I wrote the previous post I found Neil's example:

http://revisual.co.uk/?tag=statemachine

which is cool also because it combines StateMachine with the AsynchCommand ,  but it's the old version of StateMachine and I still don't know how to apply it to CRUD operations.


I was actually thinking about this as I was waking this morning. Its an important thing to get out there and will happen.

That's because people like me who want this cool utility  so badly, think intensively  about it while you are sleeping.;-)


However, I'm full-on busy at the moment, I just can't say, though I wish I could. If it weren't for the pesky business of having to actually do other stuff for a living I'd get way more done here.
I  know what you are talking about.
And how short a day is when you want to have lots of things done by the end of the day.

Actually I kind of feel bad right now.  I'm trying to use your framework and those utilities for my current project  (that I'm working on for a living) while you guys support us ( the community) for free in your spare time. There should be  a “Donate” section on the web-site. It wouldn't make you rich, but maybe it would help you cover the costs for the website?


Oh  I just saw the better solution that Jason suggested.
I also say YES to Cliff's cloning
( 1564-1 = 1563 clones needed?)
77  PureMVC Manifold / Demos and Utils / Re: StateMachine - A PureMVC / AS3 Utility on: March 03, 2009, 08:35:01
Thank you Neil for the utility.
Thank you  Cliff for the changes.

from http://trac.puremvc.org/Utility_AS3_StateMachine/wiki/ReleaseNotes:

Passing data between States. When sending a StateMachine.ACTION notification, you may include any Object as the body of the notification and it will be included in the state-specific 'exiting', 'entering', and 'changed' notifications. This allows, for instance, the data collected from a UI form in the 'DATA_ENTRY' state to be passed to the 'DATA_SAVING' state when the form's 'Save' button is pressed, for instance.

This is really very useful!!

A more 'real-world' demo will be forthcoming.

I know, I know. You are very busy:)
But I can't stop myself from asking: when?
Can you give us an approximate time frame? 1 week, more weeks, 1 month?
78  PureMVC Manifold / MultiCore Version / MultiCore + AIR + resize window on: February 27, 2009, 04:23:59
I'm 7 days old (puremvc time).
So I still know/remember what newbies go through when trying to use this (or other new) framework in their projects and I thought that before leaving (some day..) the puremvc-kindergarten I could tell the newbies coming after me how  to play with the coolest puremvc-toys.

I took the CodePeek example and simplified it and made it run under the MultiCore version.
Maybe there is such an example already, but I didn't find it even after in depth search. If the post isn't useful or if it is redundant you (moderators) can delete it.
I don't know if everything is correct in my code below but it works.

MultiAir
libs
   PureMVC_AS3_MultiCore_1_0_5.swc

   Utility_AS3_MultiCore_AIR_DesktopCitizen_1_2_1.swc
   (This utility provides the ability for PureMVC-based AIR applications remember their window size, position and maximized state each time it is launched. )

src
      org.controller
      StartupCommand.as
org.view
   components
      AppControlBar.mxml
   AppControlBarMediator.as
   ApplicationMediator.as
ApplicationFacade.as

   MultiAir.mxml
------------------------------------
MultiAir.mxml (main)

<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml"
   xmlns:view="org.view.components.*"   
   applicationComplete="facade.startup(this)"
   layout="absolute"
   >
   <mx:Script>
      <![CDATA[
         import org.ApplicationFacade;
         // App name
             public static const NAME:String = "MultiAir";
         // Initialize the PureMVC multicore-apparatus
             private var facade:ApplicationFacade = ApplicationFacade.getInstance( NAME );
             [Bindable] public var showControls:Boolean = false;    
      ]]>
   </mx:Script>
   <!-- The Application Control Bar -->
   <view:AppControlBar id="controlBar"/>
   <mx:TextArea x="10" y="10"  width="250" height="250"/>
</mx:WindowedApplication>

------------------------------------
ApplicationFacade.as

package org
{
   import org.puremvc.as3.multicore.utilities.air.desktopcitizen.DesktopCitizenConstants;
   import org.puremvc.as3.multicore.utilities.air.desktopcitizen.controller.WindowOpenCommand;
   
   import org.puremvc.as3.multicore.patterns.facade.Facade;
      
   import org.controller.StartupCommand;
   import org.controller.ShutdownCommand;

   public class ApplicationFacade extends Facade
   {
      // Notification name constants
      public static const STARTUP:String            = "startup";
      
      public function ApplicationFacade( key:String )
       {
          super(key);   
       }
       
        public static function getInstance( key:String ) : ApplicationFacade
        {
            if ( instanceMap[ key ] == null ) instanceMap[ key ]  = new ApplicationFacade( key );
            return instanceMap[ key ] as ApplicationFacade;
        }
   
      public function startup ( app:MultiAir ) : void
      {
         sendNotification( STARTUP, app );
      }
         
      override protected function initializeController () : void
      {
         super.initializeController();
         registerCommand( STARTUP, StartupCommand );
      }   
   }
}
--------------------------------------------
StartupCommand.as

package org.controller
{
   import org.puremvc.as3.multicore.interfaces.*;
   import org.puremvc.as3.multicore.patterns.command.*;

   import org.view.*;

   import org.puremvc.as3.multicore.utilities.air.desktopcitizen.DesktopCitizenConstants;
   
   /**
    * Create and register <code>Proxy</code>s with the <code>Model</code>.
    */
   public class StartupCommand extends SimpleCommand
   {
      override public function execute( note:INotification ) :void   {
         
         var app:MultiAir = note.getBody() as MultiAir;
         
         facade.registerMediator( new ApplicationMediator( app ) );
         sendNotification( DesktopCitizenConstants.WINDOW_OPEN, app.stage );
      }
   }
}
-------------------------------------
ApplicationMediator.as

package org.view
{
   import flash.events.Event;
   
   import org.puremvc.as3.multicore.interfaces.*;
   import org.puremvc.as3.multicore.patterns.mediator.*;

   import org.ApplicationFacade;
   import org.model.*;
   
   import org.puremvc.as3.multicore.utilities.air.desktopcitizen.DesktopCitizenConstants;

   public class ApplicationMediator extends Mediator implements IMediator
   {
      // Cannonical name of the Mediator
      public static const NAME:String = 'ApplicationMediator';
      public function ApplicationMediator( viewComponent:Object )
      {
         // pass the viewComponent to the superclass where
         // it will be stored in the inherited viewComponent property
         super( NAME, viewComponent );
      }
      public function get app():MultiAir{
         return viewComponent as MultiAir;
      }
      override public function onRegister( ):void
      {
         facade.registerMediator( new AppControlBarMediator( app.controlBar ) );
      }
      override public function listNotificationInterests():Array
      {
         return [ DesktopCitizenConstants.WINDOW_READY];
      }
      override public function handleNotification( note:INotification ):void
      {
         switch ( note.getName() ) {
            
            // Time to show the application window
            case DesktopCitizenConstants.WINDOW_READY:
               app.showControls = true;
               break;
         }
      }
   }
}

-----------------------------------------
AppControlBarMediator.as

package org.view
{
   import org.puremvc.as3.multicore.interfaces.*;
   import org.puremvc.as3.multicore.patterns.mediator.*;

   import org.ApplicationFacade;
   import org.view.components.AppControlBar;
   
   /**
    * A Mediator for interacting with the AppControlBar component.
    */
   public class AppControlBarMediator extends Mediator implements IMediator
   {
      // Cannonical name of the Mediator
      public static const NAME:String = 'AppControlBarMediator';
      
      public function AppControlBarMediator( viewComponent:Object )
      {
         super( NAME, viewComponent );
      }
      protected function get controlBar():AppControlBar{
         return viewComponent as AppControlBar;
      }
   }
}
---------------------------------
AppControlBar.mxml

<mx:ApplicationControlBar xmlns:mx="http://www.adobe.com/2006/mxml" dock="true">
   
   <mx:Script>
      <![CDATA[
      import org.ApplicationFacade;

      public static const BEGIN_CODE_SEARCH:String    = "beginCodeSearch";
      public static const CANCEL_CODE_SEARCH:String    = "cancelCodeSearch";
      
      [Bindable] public var comboOptions:Array;
      [Bindable] public var searching:Boolean = false;      
      
      /**
       * Initiate Code Search.
        */
       private function search() : void
       {
          searching=true;
           dispatchEvent( new Event( BEGIN_CODE_SEARCH ) );
       }
           
      /**
       * Cancel Code Search
        */
       private function cancel() : void
       {
          searching=false;
           dispatchEvent( new Event( CANCEL_CODE_SEARCH ) );
       }
           
      ]]>
   </mx:Script>
   
   <!-- The Search Controls -->
   <mx:HBox width="75%">
      <mx:ComboBox id="searchCombo" dataProvider="{comboOptions}" close="searchTI.setFocus()"/>
      <mx:TextInput id="searchTI" width="250" toolTip="Enter a language keyword or code fragment." enter="search()"/>
      <mx:Button label="Search" click="search()" enabled="{(searchTI.text.length != 0)&amp;&amp;(!searching)}" />
      <mx:Button label="Cancel" click="cancel()" visible="{searching}" />
      <mx:Label text="Searching..." fontFamily="Courier" fontSize="10" visible="{searching}"/>
   </mx:HBox>      
</mx:ApplicationControlBar>
--------------------
N.B. I took out the long comments for  readability's sake.

Ondina
79  Announcements and General Discussion / General Discussion / PopUps again on: February 26, 2009, 09:57:53
I found these posts related to how to manage a PopUp, that provide examples:

http://forums.puremvc.org/index.php?topic=105.msg367#msg367
--
http://forums.puremvc.org/index.php?topic=257.0
with this  link to an example:
http://www.lfpug.com/presentations/2008_01_31_keane/ApplicationConfigExample.html
--
http://forums.puremvc.org/index.php?topic=995.0
with this link to an example
http://www.nutrixinteractive.com/blog/?p=329
--

Do you know which one has the better solution in the context of puremvc?


Thanks, Ondina
80  Announcements and General Discussion / Getting Started / Re: Steps to follow on: February 26, 2009, 07:22:10
Hello Cliff ,

Thank you for answering.

I'm sorry for calling the utilities “junk”, but it's all Joel's fault:)

“When you open your app, you want it to be a good desktop citizen, and behave like most native apps; namely to restore its size and position info as well as whether it was maximized. “

YES.  I definitely want this to happen.

I already tried the RSS Headlines and CodePeek  examples among with all the other examples available for Flex/AIR/PHP/JavaScript.  I should focus only on AIR at the moment , but I was very curious about the PHP and JavaScript ports. By the way I can't stress it enough, how good it is that those ports exist. Too bad the PHP and JavaScript people don't know about them.

I'm jumping from one example to another to see what they can do, what they can not do and so on.
It would be very useful if there was an example combining all the cool things puremvc is providing, even if it would be difficult for newbies to understand it at the first glance.
If  I would know more about puremvc I would contribute to the community with such an example.
Maybe some day.....

For now:

DesktopCitizen  is already  on my puremvc-tools list!

O.K. I will wait for the next version of the StateMachine utility.

“The StopWatch demo actually still works as written, but its not representative of real world use. “

Right, and at this stage of my puremvc journey I don't know how to use it in my application.


I discovered the Fabrication utility. Would it be good for a newbie to start with it? Actually I know the answer to my question.

Anyway thanks again Cliff for taking care of us.

Ondina
81  PureMVC Manifold / MultiCore Version / Re: Handling PopUps on: February 25, 2009, 12:22:50
Thank you for the demo.
It is very useful :)
82  PureMVC Manifold / Standard Version / Re: who can share the demo on: February 25, 2009, 12:14:43
The demo is great!!

Ondina
83  Announcements and General Discussion / Getting Started / Re: Steps to follow on: February 25, 2009, 06:49:51
@Joel I watched the uncensored video on YouTube and read the lyrics. They made me laugh a lot.
I sent the link to all my (male) friends. I 'm not sure if I should tell my husband about the sketch myself or let my friends give him the tip and I'll just act surprised after receiving the box. ;-)

Following the step-by-step instructions:

Step 2:  After cutting a hole in that puremvc-box I was wondering what should I  put in there.
So I made a list of all the puremvc-”junk”  that I could use for my AIR application I'm working on.

While trying other frameworks I got stuck because of their lack of complex examples and utilities.
Now I'm kind of stuck because I -as a beginner- don't know what to choose from the many examples and utilities that puremvc is offering (  which is absolutely great ) and how to put them together.

My Application is a combination of regular Flex Components and Modules.

I decided that I needed the MultiCore version of the framework with the functionalities provided by Pipes, StateMachine and AsyncCommand. 

Question : Is there an example that uses Pipes + StateMachine + AsyncCommand
all together?

Thanks, Ondina
84  Announcements and General Discussion / Getting Started / Re: Steps to follow on: February 24, 2009, 11:39:28
@Cliff
Thanks for answering and for the welcome.

@Joel
You made me google “cut a hole in that box “ :)
 I didn't know this idiom before  because of my mediocre English and because I didn't see the sketch featuring Justin Timberlake and Andy Samberg - that comes up when you search for those keywords. From  Cliff's comments I inferred  that it was meant well.
85  Announcements and General Discussion / Getting Started / Steps to follow on: February 24, 2009, 09:27:07
Hello

I've been reading many posts on this forum,  tutorials/articles and the FAQ section  for the last 3 days.  I'm more and more inclined to use puremvc for my project.  Actually I'm already rethinking my specific use cases from the puremvc perspective and as far as my theoretical knowledge about the framework goes it seems to be able to solve my problems.
Now my project is very complex and refactoring it is not easy, especially because I have to do it fast.  Not that I am in a hurry, but the customer is. I bet you know what I mean.

I'm wondering if it's the right approach to get help from you  if I'd post a list of my questions regarding the project's architecture and you would point me to the place where the same questions were answered already?

Or  is it better to stick to one specific question  per post?

The best way for me would be if I could show you an approximate structure of my project and mark the problematic parts, for example in form of a diagram like the ones below and then instead of a lot of words describing what I wanted you could see it immediately on a diagram.

I don't know if it's ok to post images, but since the text editor on this forum allows it I thought I could try. These were my first steps on the way of understanding puremvc:

see attachment 1
see attachment 2


Now this was a very simplified scenario with a one-way flow without response(client->server), but did I get it right so far?

I'm sorry if I'm too intrusive.

Thanks, Ondina

N.B. I don't want to call Cliff.
86  Announcements and General Discussion / Getting Started / Does the frame work? on: February 23, 2009, 07:37:55
I am new to this framework. Just saying hello, while reading the posts on the forum and trying out the examples.

Currently I am trying to decide which one of the most popular (Flex) frameworks is more suited to satisfy my project's needs. Not an easy job, I must say.

After much reading and trying the widely known “Cafetownsend” example (and others) in the different (frameworks)variations my current state of mind is something similar to the excerpt from

Design patterns explained by Alan Shalloway and James R. Trott

<<
....
According to the Gang of Four, the intent of the Bridge pattern is to  “De-couple an abstraction from its implementation so that the two can vary independently.”

I remember exactly what my first thoughts were when I read this:
Huh?
And then,
How come I understand every word in this sentence but I have no idea what it means?!

I knew that
• De-couple means to have things behave independently from each other or at least explicitly state what the relationship is, and
• Abstraction is how different things are related to each other conceptually.
And I thought that implementations were the way to build the abstractions; but I was confused about how I was supposed to separate abstractions from the specific ways that implemented them.
......
>>

The first impressions about PureMVC:

-its  portability is very attractive. Right now I'm working on an AIR project, but  some month from now I might be working on a web project using AJAX and PHP, or maybe just Flash.
-the community seems to be very active and there are some interesting contributions coming from the members
-the FSM implementation,  Startup Manager utility, Pipes are very appealing, as far as I understood them from their description and demos
-the showcase section is encouraging for beginners, meaning that someday somehow they will be able to do it alike or that the framework is old enough to be already over the “HelloWorld” stage and is addressing the needs of a real world application

That's it for now. I hope I will be able to dive into code quick and painless, so I can see more than a nice facade:)

Ondina
Pages: 1 ... 4 5 [6]